Typically I use the octo.exe app deploy applications via command line. i was curious if it was possible to do the same thing through the REST API. If so, how is that done?
Nevermind I found out how it is done. I visited Github and looked at the master branch. There is a script for creating and deploying releases at https://github.com/OctopusDeploy/OctopusDeploy-Api/blob/master/REST/PowerShell/Deployments/CreateReleaseAndDeployment.ps1.
Here is how the deployment itself is done.
#Creating deployment
$DeploymentBody = @{
ReleaseID = $r.Id #mandatory
EnvironmentID = $Environment.id #mandatory
} | ConvertTo-Json
$d = Invoke-WebRequest -Uri $OctopusURL/api/deployments -Method Post -Headers $Header -Body $DeploymentBody
Hi,
I’m happy to hear you found a good solution! Let us know if you have any other questions
Kind regards,
Kenny