I am setting up a process for patching containers. Part of this process has me rebuilding the source code using the code version that had been released to prod most recently. That all works fine.
My issues come when I am releasing it. I am doing a Blue Green deployment model. So, while I am building a patch from the same source, it is entirely probable that the variables in Octopus Deploy have changed during the start of development for the next release (on the alternate Blue/Green deployment pipeline)
I need a way for a release to use the same settings as a previous release, except for the one I need to override (the docker container). I am doing all this from the REST API, so I don’t need the ability from the UI.
Is there a way, via the REST API, to create a release that uses the same version of settings as a previous release?
Thanks for getting in touch! Great question, though I don’t believe it would be possible (or at least easy) to create a new release branching from a previous release’s settings only. My first thought to address this would be to suggest something a bit different.
I think the recommended solution here, assuming I’m understanding what you’re after correctly, would be to modify the way you’re modelling your blue-green strategy. A common way to model this is to use separate, but similar, environments (e.g. Prod-Blue & Prod-Green). This allows you to differentiate the variable evaluations per environment (via binding to environment-scoped variables), all within a single release.
Another common way to model this is through multi-tenancy by having a Blue tenant and a Green tenant.
We have a good amount of documentation and knowledge base articles around the blue-green concept and how it can be modelled in Octopus which I’ll link to below in case it’s of any help.
We also have a few projects configured in our samples instance you can reference.
Thanks for keeping in touch! Great questions, and while I imagine it would certainly be possible to do so via the API, I don’t see any existing scripts in our sample repo that does exactly this. I’m not sure exactly how much would be required in writing this custom script, but I imagine a couple scripts that do exist in the sample repo might provide a good starting point.
Modify or add variable to project:
Import variables from file:
Update release variable snapshot:
I can have a look around internally as well to see if I can find anything else potentially helpful.
Let me know if you have any questions in the meantime!