Prompted variables not "saved" when promoting release to a different environment?

I have an OD project where a few variables are prompted (prompt for value) and these are set via octo.exe in a TFS Build step and I’m just passing through some information about the build that creates the release and then is deployed via OD.

The first deploy of that release goes fine to the desired environment and all prompted variables have the values sent from TFS, however once i promote that release to a different environment the values for these prompted variables are gone!

Is it supposed to be like this or is it a bug?

We are running Octopus Deploy version v2018.4.5

Hi Carl,

Thanks for getting in touch! This is actually the expected behavior. Prompted variables have their values defined at deployment time, and not at release creation, so the value needs to be supplied when deploying to each environment. There’s an existing UserVoice suggestion to enhance this and allow you to “remember” the value you provided during the first deployment for subsequent deployments through your lifecycle. I’d recommend throwing it some votes!

For the time being, would giving this prompted variable a default value help?

Please don’t hesitate to reach out if you have any further questions going forward. :slight_smile:

Kind regards,

Kenny

A default value wouldn’t help as I supply information from the build itself, e.g. buildnumber, what commit/check-in, repository etc.

I will have to find another way to solve this, possibly by writing the values in a text file in the TFS build and later extract that information in the OD process… or some other more clever way.

I’ll take a look at the “Prompted Variables to save value per Release.” topic in UserVoice and maybe throw it a vote.

Thanks for the help!

Hi Carl,

You’re welcome! I can see how the default value wouldn’t work in your case; I’m sorry that doesn’t help out here. Let me know how you go with implementing your solution, and don’t hesitate to reach out if you have any further questions along the way. :slight_smile:

Kind regards,

Kenny

Hi!

I solved it in the following way:

  1. I created a PowerShell step in the TFS Build, this step creates a .txt file and is supplied with the values that I require in OD (e.g. MyTFSVariable=TheValue).
  2. This file is later packaged together with all other files in a .nupkg and sent to OD.
  3. In OD, the step where I required the values from TFS is written in PowerShell, so I just had to use a regular expression to read the values from the .txt file and use them in that step.

Above solved my problem, although it is a bit more “hidden” meaning not as visible for future engineers when they need to change this process. Variables does make the process more transparent…

But it worked and I’m perfectly happy with that :slight_smile:

/ Carl

1 Like

Hi Carl,

Thanks for following up and taking the time to outline your solution. That sounds like a great approach, and it’s good to hear you’re happy with it! I couldn’t think of or find any alternatives, so I think you’re right on the money. :slight_smile:

Let me know if you have any further questions or concerns moving forward!

Best regards,

Kenny

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.