Create Condition So An Environment Can Only Receive 'stable' Packages

I feel my current arrangements of projects could be better but can’t work out how to achieve what I want - so maybe I am missing a trick.

What I would like to do is use the ‘version’ number part of the Library Packages to control whether an environment can received a deployment or not.

So for example, a given project deploys several packages into ‘test’ environments and I would like to change the versioning of those package to make it clear the package is a test package (a bit like NuGets work with vabcd in them).

When we believe the testing is good we do a release build - where the version changes to a ‘stable’ one.

I would therefore like to set a rule that says deployments to ‘env x’ can only occur if ALL of the involved packages are stable?

That way I can have Test1, Test2, Test3…PreRelease…Release…where PreRelease can only take stable packages and Release can only occur once PreRelease is deployed.

Can anyone help explain to be how to achieve this?

Thanks

Hi Stuart,

Thanks for getting in touch!

I believe what you’re looking for is Channels. We have a blog post that covers this kind of setup, although it is a little dated so I will cover the basic steps involved here too.

There are a few parts to this configuration.
Initially, you would need to create a lifecycle for each channel you need e.g.
image

Then you would create a Test channel and assign the test lifecycle, also you would want to assign a version rule so that releases can only use test packages. A common way of doing this is through the use of pre-release tags such as -beta.

Then do the same for the Production channel, with a slightly different version rule that will exclude any packages with pre-release tags.

Now, you can create releases for each individual channel and don’t need to worry about someone accidentally deploying a test version to production.

There is a fair few bits going on here, so let me know if you’d like me to dive a bit deeper into any of it.

Regards,
Paul

Thank Paul - that sounds promising - I will try this concept out as a test…although my first thought is “at the point of creating a release” I still want this to contain the latest versions, whether the latest be beta or stable…but at the point of deployment to test it doesnt care is they are test/beta…but at the point of deploy to Release Channel it will object if the release contains any beta packages.

It sounds like it might behave slightly differently to this…but I’ll give it a go.

1 Like