400 Error talking to Octopus 3.0 API
Closed this issue · 4 comments
I tried to use client.helper.simpleCreateReleaseAndDeploy
with an Octopus Deploy 3.0 server. It gave me a 400 response with the error:
No package version was specified for the step \'Deploy Front-end Website\'
It seems the Octopus Deploy API has changed - as per this support ticket:
http://help.octopusdeploy.com/discussions/problems/35372-create-release-a-version-must-be-specified-for-every-included-nuget-package
The linked gist provides a fix in Powershell:
https://gist.github.com/Dalmirog/0fa1116a496b8b545a7d
In the current client.helper.simpleCreateReleaseAndDeploy
interface there is no way to specify either:
- a list of selected packages, or
- a default package version for all steps
One or both of these are needed I think. I think (2) provides a better option as I don't have to specify the full list of step names and it's probably the more common scenario. However, for some reason the API doesn't seem to take in a single default package version.
So my suggestion would be to make the interface:
helper.prototype.simpleCreateReleaseAndDeploy =
function (projectSlugOrId, version, packageVersion, releaseNotes, environmentName, comments, variables)
The change is that packageVersion
parameter has been added and can be passed down into release.create
.
This would require doing a get on /deploymentprocesses
(https://github.com/OctopusDeploy/OctopusDeploy-Api/wiki/DeploymentProcesses) which returns a an object with a collection of Steps
.
Then in release.create
it could create the list of SelectedPackages
as per the gist linked above and set the version on each one to the passed-in packageVersion
.
What do you think?
Thanks for the feedback. I'm no longer using this library, therefore have no interest in maintaining it.
Are you interested in taking ownership of this library?
I don't think I can actively maintain it myself (am a bit new to open-source programming to be honest). However, I have submitted a pull request with the fix, which I've tested on my current project. It works.
Can I close this?
Yes fine by me. Thanks.