Re-deploy existing release but with current variables?

Is it possible to re-deploy an existing release, but the current library variables?

When using the “Deploy a Release” built-in step, I know that I can override specific variables.

But is there any way to override all variables with their current values?

When a Release is created, it takes a snapshot of the variables. If variables are updated, it is possible to update the variable snapshot of an existing release.

  • Click on Releases
  • Click on the Release you are wanting to update
  • Click on Update Variables

1 Like

Is it possible to do that from the calling project (the one with the “Deploy a Release” step)?

Or, barring that, how can I update the variables of a release through the Rest API?

Thank you very much.

I do not believe it’s an option in the Deploy a Release step, but it’s actually pretty easy using the API. You could do something like,

$OctopusServerUrl = ""

# Call the API to update
$deploymentProcess = Invoke-RestMethod -Method "post" -Uri ("$OctopusServerUrl/api/Spaces-1/releases/Releases-3400/snapshot-variables") -Headers @{"X-Octopus-ApiKey"="$ApiKey"}

In that example the Release ID is hardcoded, but you could figure out what it is and then put that in the url for the snapshot command.

1 Like

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