I have a lot of variables that are set per project, but the variable names, scopes, descriptions, etc are the same across all of the projects.
Is there a way to define a global Variable Set and then just set the values in the project?
For example, I would have the following variable in the set:
Variable Name: ApplicationName
Variable Description: Name of the application as defined in the App Database
Variable Scopes:
Environments: Dev, Test, Stage, Prod
Channels: Release, HotFix
I have many more like this (ProductName, MaxPods, MinPods etc). I would like to define these in one Variable Set, and then just set the values in each of the projects (without having to define the variable again in the project).
Once you have everything you want as a Template you’ll be able to link the Library Variable set to the Project like normal and it will pull in your Common variables:
Sorry for the misunderstanding I believe I get what you’re saying now.
There doesn’t seem to be a way to do this through the UI but you could use something like this Powershell API script to add variable sets in the way you’re describing:
You will fill out your values at the bottom around line #145. As with any script, please understand and test before running in a production environment.
While I don’t mind using scripts, the people who actually have to set the values in each project will not feel comfortable doing that.
While tedious and a bit error prone, I will just continue creating the variables manually in each project so they can use the normal editors of Octopus when they set the values.
Thanks for getting back to me with your use case. You should be able to run this script and basically “import” a set of Project Variables that will be editable by anyone that has access to the Project. This way you can easily define a list of common variables into the Project, for example: