I had similar trouble with this myself.
In order to create a release, you must make a POST
request to the Octo server.
https://myoctoserver:port/api/releases
Provide the following headers:
- X-Octopus-ApiKey: API-XXXXXXXXXXXX
- Content-Type: application/json
The body of the request must be JSON
. Below is an example:
{
"Version": "2017.02.25.183053" ,
"ProjectId": "MyProject" ,
"ChannelId": "DefaultOrOtherChannelId
}
The Version
and ProjectId
properties are required. Channel ID is optional. However, if you have more than one channel or if no channel in your project is marked as default then you must include ChannelId
as well.
I hope this helps!
Curl Example
The sample below has been successful.
BODY='{"ProjectId":"'$PROJECT_ID'","ChannelId":"Channels-1","Version":"'$VERSION'","SelectedPackages":[{"StepName":"$STEP_NAME1","Version":"'$VERSION'"},{"StepName":"$STEP_NAME2","Version":"'$VERSION'"}]}'
curl -X POST --write-out %{http_code} --silent --output /dev/null -H "X-Octopus-ApiKey:$API_KEY" -H "Content-Type:application/json" -d $BODY "https://octopus.example.com/api/releases"
Notes
In order to find the ChannelId
and ProjectId
I had to query the Octopus database. The IDs will look something like Projects-1
or Channel-1