This is a feature request.
I have occasion to need to know the current value of a setting during a deployment (in the code). This need is usually when there will be a delay between when the release is made and when the deployment happens. (Some times it takes a while to get through all the environments, or I am doing a re-deploy.)
An example of this, is when I am re-deploying a service, I need to know what the current endpoint is (blue/green). The snapshot value is not useful in this case because it is the value as it was when the release was made. But I need to know what is currently set in the variables.
Now there are a few workarounds to this, but they come with significant drawbacks:
-
Update the variables before re-deploying
This will get you the current value of a variable, but it also re-sets all the other variables. There is no way to say, “Just update this one variable in the snapshot”. Frequently a full refresh of the variables is damaging to the overall deployment.
-
Use the API to get the current value.
This works well, but then you need to have stored credentials that have access to the API. This means that the project variables have to store that credential. This is a security hole that is not ideal. (Even though Octopus tries to hide sensitive variables, there are ways around it, like writing to a file.) And you cannot limit variable access to just one variable. It has to be for all of them nor none of them. And if you want to limit it per project, then you need to make and manage an API user per project to make that limitation.
I would like to request that a type of variable be created that will always return the current value (as found in the Variables page). (Meaning that it will not rely on a snapshot value when deploying.)