Remove deployment target at deployment

Hi,

Is it possible to remove a deployment target from all subsequent steps during a deployment? I don’t want to have to add code to keep checking and excluding the deployment target from each subsequent step if there is an in-built feature/single command to remove a node.

For example, I have 3 steps and each step is configured to execute against all targets. The design of my project is such that a deployment can in some scenarios continue if a single node has a failure.

  • Step 1: runs successfully against all deployment targets.
  • Step 2: during a custom validation check a deployment target fails. I want the deployment to continue for all except the failed target.
  • Step 3: should only run on those deployment targets which are still considered to be valid.

Many thanks,
Blair.

Hi Blair,

Thanks for reaching out. On the below doc, there’s a section called Including and excluding targets during a deployment which shows how to use the Health Check step to re-evaluate machines during the deployment, and only move on with the machines that are healthy

Hope that helps!
Dalmiro

Hi Dalmiro,

Thank-you for the feedback. The health check feature does not help me in my situation as it is my own custom validation code which will decide if a machine is suitable or not. My validations go beyond that of the existing health check step.

Are there any other existing features which can help here or would I need to code the exclusion at the start of each step?

Best regards,
Blair.

I’ve come across an existing enhancement under development which will probably help me in my situation. It should be cleaner than putting the evaluation into my own code in each step.

Allow the Run Condition of an Action to be based on a variable expression #2984

Best regards,
Blair.

Hi Blair,

That enhancement should definitely come in handy for your scenario.

For the time being the closest I can think of is the approach I mentioned above using the “Health Check” feature, along with a script that disables the targets dynamically using the Octopus API.

Regards,
Dalmiro