Are prompted variables set at release creation time retained for deployments?

Background: we want to associate the Git commit hash of a build with an Octopus release so that we can create a GitHub release and tag as part of our Octopus deployment process.

I tried using Prompted Variables for this - in TeamCity we pass additional command-line arguments to Octo.exe so the command looks something like:
Octo.exe (...) -v "GitCommitHash:%build.vcs.number.1%"

We then use #{GitCommitHash} as the target commitish in our GitHub - Create Release step.

This doesn’t work, however - our prompted variable (GitCommitHash) is blank when we go to deploy, despite it being set on the Octopus release (incidentally, is there any way to view the values of prompted variables on a release?).

Is there a way to make the prompted variable value set at release-time be retained for deployments of that release? Alternatively, is there a better way to save arbitrary data about a build on an Octopus release object? We’re already using --releasenotes for something else.

Answering my own question: metadata looks exactly like what we want.

Hi David,

Thanks for getting in touch! That’s great to hear you’ve found what you’re after, thanks for letting us know. :slight_smile:

I’d just like to quickly note that prompted variable values are provided at deployment time and not at release creation. A kind of exception to this is you can provide a value to a prompted variable at release creation in this way in order to accommodate for auto deployments.

Don’t hesitate to reach out if you have any questions or concerns moving forward!

Best regards,

Kenny

1 Like

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