Dynamically select the environment before deployment

Hi,
We have a requirement where a code promotion lifecycle (Sequence of deployment to the enviornment) is not fixed.

That means we can not create to sequentially deploy to the environment or phases.

Hence, we need to manually select the environment to deploy. How this can be implemented.

For ex.
CASE I)
Suppose I know that the code promotion lifecycle is fixed (For ex. Dev → SIT → UAT).
In this case, I will create a lifecycle and define the sequence in the lifecycle accordingly.

CASE 2)
There is no fixed sequence. Hence, rather than creating a fixed sequence, I may need the team to select to which envirornment, the code can be promoted next . How this can be achieved?

I hope I am able to clearly articulate the question here.

Regards,
Rahul

Hi @rahul.bhoyar,

Thanks for reaching out to Octopus Support! I’d be happy to help answer your questions about this deployment scenario.

I think the best way to handle this is using a combination of lifecycles and channels. You could create a lifecycle with a phase not scoped to any specific environment. That will allow any environment to be selected when a release uses this lifecycle.

Example:

In your project, you can create a new channel and associate it with the new lifecycle. When you have a release that you know you will want to deploy to any environment, you can assign the release to the new channel. In my example below, I have a ‘Hotfix’ channel that uses a lifecycle with all environments. Once I create a release in this channel, I can deploy it to all my environments.

Channel:

Release:

Deployment:

Our documentation (Channels | Documentation and Support) also goes into more depth about setting versioning rules and other channel configuration options. Please let me know if you think this would work for you or if you have any further questions for us.

Thanks!
Dan

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