Configured AWS Auto Scalling groups and a newly created instances register in the Octopus automatically
Automatic deployment for newly created instances with Deployments->Triggers
2 Channels in our project. Let’s call it “simple”, and “extended” which has some additional steps
Developers usually deploy with “simple” channel, but let’s assume:
A developer deploys a package with “extended” channel selected. Then we terminate an instance or extend our Auto Scalling group, so that a new instance is created, registered in the Octopus and a package is auto-deployed. But, the package is deployed with “extended” channel (because it was last used) and additional steps are executed. We would like to auto-deploy newly created instances always using “simple” channel to avoid running additional steps from “extended” channel. How can we obtain that? Any help will be appreciated.
Potential solutions I was thinking about:
Add a step that fails at the end of “extended” channel process, so that the “simple” channel will be triggered to auto-deploy, but that way the latest version from “simple” channel is deployed, not the latest from both channels.
Create a new project for auto-deployment which will have the steps from “simple” channel only. But not sure how to point the auto-deployment project which version to use - in other words - which version is the latest from the main project. Also which step template to use here (“Deploy Child Octopus Deploy Project” / “Chain Deployment” / “Deploy a Release”)
Trigger deploy with “simple” channel always when the “extended” channel finishes.
Additionally, we have several environments and several target roles are used during the deployment.
I have a few ideas I want flesh out and build a sample for. I’ll carve out some time tomorrow and put together a sample or two. It might take me some time to get it all together. I wanted to let you know so you didn’t think this fell into a black hole.
Bad news first, you cannot change a channel once a release has been created. In this scenario:
A developer deploys a package with “extended” channel selected. Then we terminate an instance or extend our Auto Scalling group, so that a new instance is created, registered in the Octopus and a package is auto-deployed. But, the package is deployed with “extended” channel (because it was last used) and additional steps are executed.
Because the latest release used the extended channel, any deployment target trigger will use the extended channel.
The good news is this shouldn’t require you to create new projects or have failures in your process. I think we can accomplish your requirements using a variable run condition.
I’ve put together a sample for you to look at here: Octopus Deploy