We currently have 3 deployment environments (Alpha, Staging and Prod). I was tasked with utilizing Octopus to assign certain app.config and web.config transforms to an environment, but only when we want. Normally, I scope a variable set to an environment and those transforms get done if Octopus matches that environment. How best would I have an optional “change these settings in the web.config for either Alpha or Staging when I click a button” in Octopus?
Thanks for reaching out. Partial deployments is not something we like to encourage with Octopus. By partial we mean “Deployments where you just deploy a handful of files, instead of all the necessary files for your app to work”
That said, you could have a step that’s just like your regular deployment step (with transforms included), that also contains a pre-deploy script that deletes all the files except the transform ones and a post-deploy script that copies the config file to the path where you need it.
Once you have that step, if you are planning to use it often I’d recommend you to scope it a specific channel with a meaningful name like “DeployOnlyConfigFiles”. That way when you trigger a deployment for that channel, only that step will be executed.