Offline deployment step variable json files contain all variables

When playing with offline deployment functionality, I noticed that the variable json files for each deployment step contain a snapshot of all the variables for the project that target that deployment context. This creates a large amount of white noise should anyone want to edit those variable files.

It would be great if Octopus Deploy would only include the variables in the step json file that are used by the step. Finding a variable used by a single step in order to change its value will then be much easier and less error prone. As is, the risk is that someone will update the correct variable but for the wrong step.

Hi Rory,

Thanks for getting in touch! And thanks for moving this from GitHub we try to keep that to items we are committed to completing.

Could you explain a bit more about your use of the offline deployments feature and why you would want to edit the variables?
We think that our usage and documentation might be a little lacking as we have had this question/comment/suggestion come up one or twice.
The feature was designed to be a single deployment/machine package. So if you had a project that needed to go to several different websites you would have several offline drop locations and the variables would be scoped accordingly.
Think of it similar to a Azure web app deployment and not a Tentacle machine many locations available endpoint.

Let me know what you think and if you could expand on your impression of the feature and potential use.
Vanessa

Hi Vanessa,

We have a scenario where we need to deploy into a secure environment. That production environment is one that we don’t control but we do control every other environment before prod. This means that OD works great for all of those environments.

I started looking at offline deployment packages in order to support the secure environment. The issue we have is that because we don’t control that production environment, we don’t know all the information to populate the variables. For example:

  • What is the connection string to the SQL server for us to install the database to?
  • What is the path on the web server where we will publish the website to?

In order to test this, I generated the offline packages and poked around the config files to see where I needed to change variables. What I found is that all the variables for the project were against each step. So the website deployment has database deployment connection string configuration. This makes it hard to edit variables and make sure you have modified the right config files.

What would be really cool is if there was a UI to run with the offline package where it would prompt for all the variables for the offline environment.

Hi Rory,

So you don’t necessarily want something like prompted variables when the batch file is run. You want a way to find the variables easier.
Octopus doesn’t really know when variables are used, they could be used at any time. So even to add variables to steps they would have to be scoped to steps.

My suggestion for a workaround for now would be to give it a scoped variable now for that machine - and give it a value that is 'find and replace’able such as DROPSQLCONNECTSTRING
Something that you wouldn’t use anywhere and can exact match for a quick find and replace.

We have a UV suggestion for output variables on offline drops. https://octopusdeploy.uservoice.com/forums/170787-general/suggestions/9196032-output-variables-for-offline-drops
I know that it isn’t what you want, but i think adding comments to that vote would be a good place to extend it as if we do build something to work with variables for offline drops it would be when we consider variables for the feature. Of course you can add your own specific suggestion.

Vanessa

Having the user being prompted for variables would be really good. I suspect this would have to be through a UI rather than script though. I’m not expecting a feature like this anytime soon, but I’ll put it into UserVoice.

I would have thought that you could filter down the variables used for each step rather than writing them all out to the config files. At the point that the offline package is generated you would be able to determine all the variables from the project and variable sets that apply to the current step. This is essentially what I’m after so that it is clear which steps use which variables, therefore making it easier to modify the variables. Should I add this as a UserVoice entry?

See https://octopusdeploy.uservoice.com/forums/170787-general/suggestions/12794610-allow-for-display-and-edit-of-offline-variables-at for the offline deploy variable UI suggestion

Hi Rory,

We did get comments about ‘too many files!’ in the offline package drop so adding more for variables would I am sure make that crowd unhappy.
Hopefully we get some movement on the issue you created.

Vanessa