.
Consider “X” is my project and , I want to create release for this project using powershell and using rest APIs. But If I use the above process (Deploy Release of another project) The invoke web request doesn’t work properly. showing error =>
"Invoke-WebRequest : The remote server returned an error: (400) Bad Request.
At line:53 char:6 + $r = Invoke-WebRequest -Uri $OctopusURL/api/releases -Method Post -He …
**+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**
** + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException**
** + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand** " Tried a lot but showing error.
I use this below powershell (Click URL) for creating release and deploy
If I have a simple process without the deploy a release process, it will work. But if I use this process (deploy release of another project) it doesn’t work and shows the above error.
Thanks for getting in touch! I’ve given this script a test and reproduced this behavior both with Deploy a Release steps and standard package steps. However it works if you don’t have these steps (i.e. just a script step in my testing).
Since the Deploy a Release step exposes release versions of the ‘child projects’ in the same way as package steps expose packages and versions, I think all you’ll have to add to this POST to /api/releases is the package version for each package step. Does the following sample script get this going as expected?
You’d need to input the values of your Deploy a Release step and release version of the child project in this line:
Hi, Is there any way to get the status (I mean Success, Progressing, or Failed) of a deployment to powershell ? I can’t find a proper API Key and Value for this. My Concern is here :
If the deployment is success then I need to proceed to next step in my script. If the deployment is progressing I need to wait until it become complete. If deployment is failed I need to get the failed status to my script.
Thanks for following up! You can certainly track the deployment status, either for individual steps or the deployment as a whole. There are some built-in system variables that contain this information during a deployment, and you can reference them at the following link.