Duplicated release deployment on cmd line?

Hi, I’m using Octo.exe to trigger a release creation and it’s deployment through command line on TFS, this is the command i’m using:

create-release --project “Roomex Web Apps” --server http://yoda/ --apiKey $(octopus_apikey) --deployto Development --waitfordeployment --progress --deploymenttimeout=00:20:00

It works fine, it does create a new release and then deploys it, but I’ve noticed a strange behavior, these are the TFS logs for the deployment part on Octopus:

2016-05-13T14:04:36.8063112Z Release 0.0.89 created successfully!
2016-05-13T14:04:37.6656655Z Deploying Roomex Web Apps 0.0.89 to: Development (Guided Failure: Not Enabled)
2016-05-13T14:04:37.7125353Z Waiting for 1 deployment(s) to complete…
2016-05-13T14:13:01.2184808Z Success: Step 1: Remove Default Web Site

What happens is: TFS does trigger a release and it’s deployment, which I can follow through on Octopus dashboard page, but 13 minutes later, it triggers ANOTHER DEPLOYMENT for the same release (its even named #2) and only then it starts outputting the progress on the logs.

How can I tweak this to perform the release creation and a single deployment?

Automatic Release Creation is turned OFF by the way, it was the 1st thing I’ve checked.

Kind regards,

Hi,

Thanks for getting in touch! The create-release command as you’ve shown it should do what you want.

My first suggestion would be to run that command on the command line without TFS involved to see if it is being caused by your TFS configuration or your Octopus configuration. You might need to add the --version X.X.X.X switch to set a release version that doesn’t already exist on your server. If not the only thing I can think of is that it is being triggered by one of the templates in your process.

Can you send me the logs for the two deployments that are triggered? You can follow the instructions here to download the logs, and then attach them to this discussion. If there is sensitive information in the logs, either edit that out, or you can make this discussion private by clicking the MAKE PRIVATE button on the right of the forum.

Kind regards,

Mark

Hi,

A common cause of this is that the first phase in your lifecycle is configured with an environment set to automatically deploy. See the Lifecycle Phases section of this page.

To check this take a look at your lifecycle, if one of the environments in the first phase has the lightning bolt indicator, it will be automatically triggered when the release is created. See the image for an example lifecycle

If this is the case you will either need to turn that off in your lifecycle, or just remove the --deployTo setting in your octo.exe command.

Hope that helps!

Mark

Hello Mark,

How do I remove that bolt in the lifecycle?

I’ve tried removing the --deployTo switch, and what happens is, he creates
the release, but doesn’t wait until it’s ended.

I need octo.exe to create the release, deploy it and only release the
thread when the deployment is finished, so I can move along with the TFS
flow.

Maybe I should be using 2 command lines? one for creating the release and
another for deploying it?

Kind regards,

Pedro Luz

Senior Software Developer

Roomex.com

Global Hotel Booking for Business Travel

www.roomex.com/business

http://www.roomex.com/business

Dublin

Unit D10 Nutgrove Office Park,

Rathfarnham, Dublin 14, Ireland.

Phone: +353 1 2966275

London

20-22 Wenlock Road,

N1 7GU, London, United Kingdom.

Phone: +44 20 7183 7737

Hi Pedro,

To remove the lighing bolt find the lifecycle you are using in Library -> Lifecycles and open it. Then in your phase you will need to remove the environment that has the lightning bolt then re-add it, when you re-add it you’ll get to choose whether to deploy automatically or manually. Obviously you’ll want to chose manual. Note that this will effect any other projects using this lifecycle, so if automatic deployment is needed in other projects you will need to make a new lifecycle with the configuration you need.

I think that changing this in the lifecycle and then using your original octo.exe command line, including --deployTo will give you want you want, but please let me know if you need any more help.

Mark

Hey Mark, thanks a lot, re-creating the life cycle without the automatic
deployment really worked out for us.

Maybe a good suggestion is to make possible to edit life cycles after
they’ve been created and change the automatic release option?

Anyways, just a minor tip, everything seems to be working fine now, Octopus
really saved us a lot of time and work on remote deployments, thanks for
your support :slight_smile:

Kind regards,

Pedro Luz

Senior Software Developer

Roomex.com

Global Hotel Booking for Business Travel

www.roomex.com/business

http://www.roomex.com/business

Dublin

Unit D10 Nutgrove Office Park,

Rathfarnham, Dublin 14, Ireland.

Phone: +353 1 2966275

London

20-22 Wenlock Road,

N1 7GU, London, United Kingdom.

Phone: +44 20 7183 7737