When a step is skipped

I have a two step process currently - Deploy a nuget package, then use a PowerShell script to do a Web Deploy to an Azure website. I have the option to skip packages that are already installed, which does cause the nuget package deploy to be skipped. However, I can’t figure out how to skip the subsequent PowerShell step.

As far as I can see, there are no output variables that indicate if the package step was skipped. The “Octopus.Step[step].Status.Code” variable returns “Succeeded” for the skipped step.

The final process that I’m trying to put together will consist of several of these two-step combinations. Having each PowerShell step run eats up a lot of time if it doesn’t need to be deployed.

Is there a way to accomplish this?

Hi Mark,

Thanks for getting in touch! A step is considered skipped when it is chosen to be skipped pre-deployment.
In this case the step is successful just the ‘package’ part of the step is ‘skipped’ but still the step ran to determine that the package part had already been completed - so its considered a successful step and not a skipped step. I had a look and we do not have a variable or state that you can directly use to know if this package part was not run.
However we might be able to do a sneaky workaround here using some variables to check at the top of your PowerShell script to see if they match. I am thinking we can play with the previous installation directory variables, but I need to run some tests on that first. I will try to complete them tomorrow and let you know of my results.

Thanks
Vanessa

Hi Mark,

Thanks for getting in touch. Unfortunately, it’s not possible to detect if the previous step was skipped because the package was already installed.

One option might be to move your PowerShell step that deploys the Azure website into a PostDeploy script (go to your package step -> Configure features -> choose Custom PowerShell scripts). This way, the script will only run when the package is installed.

In 3.0 we’ll be adding specific support for Azure Websites and you’ll get this behaviour automatically.

Hope this helps,

Paul

Alright – that makes sense.

Thanks for your help – I definitely appreciate it!

-Mark-

From: Paul Stovell [mailto:
tender2+dccd8df650c5de522dc06d5443ff60402bc4fb24c@tenderapp.com]
Sent: Sunday, November 23, 2014 6:18 PM
To: mark@spendboss.com
Subject: Re: When a step is skipped… [Questions #3626]

image001.jpg