I’m currently trying to set up a blue/green deployment with Octopus. However, Octopus fails to find the new machines registered by an early step.
My step pipeline goes as follows:
- Remove old machines from “RoleName” role
- Use step template to create stack (instances automatically register themselves as SSH targets with “RoleName” applied)
- Deploy to “RoleName”
- Other steps
I thought the issue might be to do with Octopus needing more time to see the new machines. So I added an extra step after step 2, which waits 2 minutes, then uses Get-OctopusMachine to check for machines with role “RoleName”. Even though this command managed to find the new machines, later steps were still skipped due to not being able to find them.
I hope this made sense. TLDR; Step templates create EC2 instances which register themselves as SSH Targets, but later steps get skipped because Octopus can’t find them.
Additionally, is there a way to enable deployments automatically to go ahead even if there’s no available machines in that role to start with?
Hi Kirk,
Thanks for getting in touch! When you register new deployment targets, Octopus first needs to perform a health check on the targets. It checks the state of the infrastructure to determine if it’s available to be deployed to. You can add a health check step within your deployment process (after your 2nd step which registers the targets), select the option Include new deployment targets in the deployment
, and Octopus will then be able to deploy to those newly registered targets. My attached screenshot shows this visually You can also check out our documentation page that includes an example of provisioning a Tentacle during a deployment.
To answer your second question, as of 3.8.7, you can commence deployments even if there are no targets! You can enable that in your Project > Process page, and select the Deployment Target settings
option under the Deploying a release
section. It is great for situations like your own where you register targets during your deployment process. You can refer to our documentation page which details this new feature.
I hope that helps! Let me know if you have any further questions.
Kenny