Design version rule

Hi,

Can someone help here how to design version rule?
We have various environments: Dev, test, UAT, Stage, Prod, and Demo. For packages in Octopus that have a version number with a pre-release tag never can be installed on STAGE or PROD environment.

So packages with version numbers including a “-”
ex
2.0.20180713.105798-rc
1.0.20180713.105789-dev
2.0.20180712.105752-af94938
2.0.20180710.5-af94881
etc

Hi Banchy,

Thanks for getting in touch! I can certainly help you out in designing your version rule. Firstly, I’d recommend looking through our Channels documentation if you haven’t yet.

Channels are a feature introduced in 3.2 which allow you a way to create different releases of your project which use different lifecycles, all based on the package version. You would first need to create a custom lifecycle which progresses through the required environment, and leaving out STAGE and PROD. You can then define a second channel in your project (under [Project] > Channels), select this new lifecycle and define the version rule.

Use .+ to match any package version that has a pre-release tag (i.e. -rc, -dev, etc.). This means any non-prelease, like 2.0.20180713, won’t be accepted in this channel. You can define the pre-release tag in your other channel to only accept packages without a pre-release tag with ^$.

Octopus can also automatically select the “best” channel for this release based on the package version used. For example, if you create a release selecting 2.0.20180713.105798-rc package version, the release will automatically be created in the specified channel which follows the lifecycle where STAGE and PROD are not included. Similarly, if you define the channel in your release creation, it’ll select the latest package that’s appropriate for the specified channel.

I hope this helps! Let me know how you go or if you have any questions moving forward. :slight_smile:

Best regards,

Kenny

1 Like

Hi @Kenneth_Bates, this helped…thanks a lot.

Hi Banchy,

Thanks for following up and letting me know the status of this! Don’t hesitate to reach out if you have any further questions or concerns in the future. :slight_smile:

Best regards,

Kenny

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