- Releases MantisBT Plugin
This plugin is a continuation of the legacy releasemgt
plugin. It allows user to store releases composed of a changelog and assets (file downloads). There have been several visual improvements and bug fixes, as well as a new REST API to create releases and upload changelogs with assets.
This plugin was developed and tested on MantisBT 2.21.1.
Extract the release archive to the MantisBT installations plugins folder:
cd /var/www/mantisbt/plugins
wget -O Releases.zip https://github.com/mantisbt-plugins/Releases/releases/download/v1.0.1/Releases.zip
unzip Releases.zip
rm -f Releases.zip
Ensure to use the latest released version number in the download url: (version badge available via the ApiExtend Plugin)
Install the plugin using the default installation procedure for a MantisBT plugin in Manage -> Plugins
.
For Apache configuration, see the example Location directive found in api/apache2-site-config
Issues and requests should be submitted on my MantisBT site.
This plugin exposes a REST API for creating/uploading releases. The Authorization
header value must be set to the API token for authentication in all requests. The token can be sreated in User Preferences for the user that will be used to make the requests under.
Example header:
Content-Type = application/json; charset=UTF-8
Authorization: DvhKlx9_g5dNkBEI4jqVmwAxaN9a1y3P
The following endpoints are available:
Not supported in v1.x
Creates the specified version if it does not already exists. Assets are attached to created or pre-existing releases. The "release" is unique to the "version", each release can have only one version and vice versa. The url part "{project}" is the MantisBT project name, case sensitive.
Request Parameters
Name | Description | Type | Possible Values | Default Value | Required |
---|---|---|---|---|---|
version | The version string i.e. 1.5.14 or 2.1.21 |
string | yes | ||
notes | The version notes, or changelog. Can be text, html, or markup | string | no | ||
notesismd | Set this flag to 1 if the notes field contains markdown |
enum | 0, 1 | 0 | no |
assets | File assets | array(object) | no | ||
dryrun | Set this flag to 1 to perform a dry run only |
enum | 0, 1 | 0 | no |
File asset parameters
Name | Description | Type | Possible Values | Default Value | Required |
---|---|---|---|---|---|
name | The file name | string | yes | ||
data | The file data, base64 encoded | string | yes | ||
desc | The file description | string | no | ||
type | The mime type of the file | string | Valid mime type | application/octet-stream | no |
The mime-type
, if not provided by the client, will be determined by the plugin. If a mime type cannot be found, application/octet-stream
will be used.
Example JSON Request Body
{
"version": "1.4.3",
"notes": ".......",
"assets": [
{
"name": "package.json",
"data": "VGVzdCB0ZXN....0IHRlc3QgdGVzdA=="
}]
}
Example Response Body
{
"id": 1432,
"url": "https://my.domain.com/mantisbt/plugin.php?page=Releases/releases#1.4.3
}
Not supported in v1.x
Not supported in v1.x