user2860691
user2860691

Reputation: 7

Powershell script to run Octopus to deploy one environment to another environment with version number

Currently when we deploy applications from Preprod to Production, our application team creates a run sheet showing Preprod specific version (1.0.x.x) needs to be deployed to Production. And then Dev ops team manually runs Octopus to deploy the specific version to Production environment. As you could imagine this manual process is painful. What we are trying to do is that write a powershell script and the script takes a version number, source environment and destination environment and runs Octopus. I would imagine some people may have written already. Could you give some directions and advice or if you have some reusable codes we would appreciate that.

Thank you in advance,

Regards

Upvotes: 0

Views: 917

Answers (2)

Nirav Mistry
Nirav Mistry

Reputation: 989

you can use octo.exe with Deploy-Release command.

ref link : https://octopus.com/docs/api-and-integration/octo.exe-command-line/deploying-releases

Upvotes: 1

benPearce
benPearce

Reputation: 38333

Octo.exe has a Promote Release command that should cover this, although it will only promote the latest release from the source environment.

It shouldn't be too hard to code your own that accepts a version as a parameter using the promote release code as a starting point.

Upvotes: 1

Related Questions