Use Octo CLI to skip all unmarked steps

I want to run a deployment via the CLI using a script that skips all steps except those marked in some way. How can I do that? I don’t want to have to modify existing or added after-the-fact skipped steps in any way. I don’t want to have to name steps to skip because steps could be renamed or new ones added, and I don’t want to have to modify the script.

Here’s an example:

  • Step 1
  • Step 2
  • Step 3 (marked in some way)
  • Step 4 (marked in some way)

Now

  • I run the script and only steps 3 & 4 are run. Yeah!
  • A step 5 is added and is not marked (i.e. nothing in the step is aware of the script)
  • I run the script and again only steps 3 & 4 are run. Yeah!

Thanks!

Hey @bob.hardister,

Thanks for reaching out to Octopus!

You can deploy any release to any environment using the deploy release command using Octo CLI. You can also pass in prompted variable values when running the command so you could set a run condition on the steps you want to skip based on a variable (prompted variable) that evaluates to true.

I hope this helps, but please let me know if you need more information.

Thanks,
Adam

Hello Adam,

Thanks for your reply. That approach does allow steps to be skipped. However, it requires the steps to be skipped and any future steps to be skipped to use conditional run variables. This involves significant risks, since our developers maintain the deployment process for their apps, they are often adding/modifying steps and have no knowledge of or concern with skipping steps. The DevOps group, which I am a member of, develops and maintains the automation for computing resource deployment, which includes AWS Auto Scaling groups. We need an approach where only the process steps required for ASG instance launch are marked.

I’m going to look into writing an Octopus API function that gets the steps, looks for a specific tenant tag and then returns the names of all the other steps, which can then be skipped when formulating the deploy-release CLI command. Any thought on how workable this may or may not be?

Bob

Thanks for the additional context.

Are you using a deployment target trigger in Octopus deploy to trigger a deployment when a new machine is added to Octopus? Or are you running a script on the startup of the machine to kick of a deployment to the new machine?

Thanks

Hi Adam,

We have used deployment target triggers in Octopus, but have had many problems with them. We switched to using the AWS ASG Lifecycle Hooks to control the launch process. The hooks operate at the instance level. That’s to say a local script on the machine being launched kicks off a deployment to itself.

I wrote the function mentioned above and it returned the steps to be skipped as expected :grinning:

Bob

1 Like