Variable is set to null if step fails

I have a deployment job where I attempt to encrypt the app config after doing a Windows Service deploy step. From what I am seeing even if everything is successful but the starting of the service, Octopus must set this variable to NULL (or it never sets it).
#{Octopus.Action[StepName].Output.Package.InstallationDirectoryPath}
While I kind of understand why if the deploy process fails, the thinking that we haven’t “installed”, but I still think that anyone who is likely to use that variable (especially if they are indicating they want to run after a failure) would still want it to contain where it tried to install.

Maybe there’s another variable I should be looking at?

Hi,

Thanks for getting in touch! Could you please enable the debugging variables on your deployment and then create a new release and send us the raw log? This’ll give us abetter glimpse of your situation

Thanks!

Dalmiro

I can, however I’m a bit confused. Are you saying you’d expect it NOT to be NULL if the Deploy Service step fails?

-Mike

Mike Peterson
IT Deployment Engineer
Preventice Solutions
A strategic combination of eCardio and Preventice

2765 Commerce Dr NW, Ste 220
Rochester, MN 55901
Office: 507-218-3053
Mobile: 507-251-2315
mpeterson@preventice.com

eCardio Diagnostics® LLC and Boost Information Systems, Inc. doing business as Preventice are independent, wholly owned subsidiaries of Preventice, Inc.

This message contains confidential information and is intended only for tender2+dd3b3f4caf@tenderapp.com. If you are not one of these recipients you should not disseminate, distribute or copy this e-mail. Please notify the designated recipients immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmissions cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. Mike Peterson therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.

Hi Mike,

Sorry for the delay to answer. Octopus will evaluate which variables are passed down to other steps at the end of each step. When the deploy step fails, Octopus wont pass down the variable #{Octopus.Action[StepName].Output.Package.InstallationDirectoryPath}.

What you could do is setup a project variable with your installation path, and then on your NuGet deployment step use this variable to set your Custom Installation Path. Then, from the other steps, you’d just call the project variable you created. This will of course force you to have a hardcoded installation path.

Would this work for your scenario?

Regards,

Dalmiro

Well I could make it work, but it wouldn’t be optimal, because I’m going to run into this for anything I want to do encryption of the config on (and right now there are a number of services). And that would be the only reason I’d be setting up a custom installation directory.

Is there something I’m missing on why you wouldn’t want to make that particular variable available later on? (Other than recoding? :slight_smile: )

-Mike

Mike Peterson
IT Deployment Engineer
Preventice Solutions
A strategic combination of eCardio and Preventice

Hi Mike,

I totally understand its not the better option :(. I spoke about this with our devs and we agreed the variable should be available on further steps even if the deployment step fails. I’ve submitted a github issue to work on this

Thanks

Dalmiro