Target role as a variable

Hey

Would like to ask if there is any option to make deployment target as a variable

Thanks

1 Like

Hi Ofer,

Thanks for getting in touch! While there’s no way to bind a step’s role to run on to a variable, there may be a good solution depending on what you’re looking to accomplish. If you’re wanting this step to run on different machines depending on environment, for example, you could define the roles accordingly on the machines configuration (in the web portal under Infrastructure > Deployment Targets > [YourMachine]) which exist in these environments.

You could also potentially configure the step to Run only for specific environments in the Conditions section of the step.

Or another option could be to define a run condition on the step.

Would any of these options help you meet your requirement? Let me know what you think, or feel free to expand on your goal and I’ll be happy to rethink this. :slight_smile:

Kind regards,

Kenny

Hey

Scenario is:
Dev team work on Branches and each branch will deploy to different Slot Azure WebApp.
I would like to define a single Project in Octo contains all the application and to let
the DEV team choose each time the target.

Workaround - Adding all the Targets to each step and let the user choose to include or exclude but it breaks the automation :slight_smile:

Is there any alternative way?

Hi Ofer,

Thanks for following up and clarifying your goal here. There are possibly a couple of options to automate which machines are deployed to. Are you looking to implement blue-green deployments to Azure? If so, we actually have a great doc page which outlines an approach (with example scripts) on deploying to a slot and then swapping them in an automated way.

If this doesn’t match what you’re after, you could achieve this segregation by configuring multiple environments and setting each machine in their appropriate environment as needed. This would allow you to deploy to a certain subset of these machines which exist in the first environment as defined in your lifecycle, then promote it to the next.

You could also take advantage of the multi-tenancy feature which allows you to specify which tenant to deploy to. These tenants would be assigned to deployment targets, and this would dictate where you’re deploying to.

Would any of these options help automate this and avoid the workaround? :slight_smile:

Let me know what you think, or if you just have any further questions or concerns moving forward!

Kind regards,

Kenny

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.