Choose a single machine from a role for deployment

Hi,
We’re thinking about introducing a functional testing step into our deployment, rather than running them manually. So our lifecycle would look like this:

Auto Deploy to Dev if unit tests pass
THEN
Auto Deploy to QA
THEN
Run functional tests against QA
THEN
Promote to live if QA passes

When we deploy to QA, we’d like to be able to deploy to a single machine, rather than the entire QA environment, so that we can be running more than one set of functional tests at a time. Is there a way to deploy to a randomly chosen machine in the QA cluster?

Hi Tom,

Thanks for reaching out. Octopus was not quite made to deploy to random places, but there’s a workaround for that :wink:

You could add a Powershell step that triggers a 2nd deployment to a random machine on an environment, and based on the success of this command, continue or not down the Lifecycle.

This script that uses the Octopus REST API will help you getting a random machine given an environment name

Once you have the machine name, you can use Octo.exe with the Create-Release parameter to start a deployment to a specific machine

Pay special attention to the paremeters specificmachines and Progress

Hope that helps!

Dalmiro