Is there an easy guide to migrate existing multi-step deployment stages to the new environment and concurrency-group properties? I'm especially looking at getting automatic resume of paused builds (= deployments). In the article Evolving deployments in Bitbucket Pipelines: Concurrency Groups and Environments there is this explanation:
Today, you still do need to use the
deployment
keyword in order to get deployment tracking for your pipeline. In order to get the benefit of automated step queueing AND deployment tracking at the same time, simply add both adeployment
and aconcurrency-group
property to your step.The
concurrency-group
logic will take precedent over the deployment lock, providing automated queueing and resumption of steps when multiple run at the same time targeting the sameconcurrency-group
.
But what about existing deployment stages with multiple steps? Can I simply move the steps out of the stage and steps with the same deployment and concurrency-group values will be treated the same as a stage? Meaning consecutive steps will be completed before another pipeline can access the step? Or could a second concurrent pipeline build run step 1 right after a first pipeline finished step 1 but before it can complete step 2. So assuming pipelines #1 and #2 running 2 steps each, say deploy and test, could it be that the order of execution is
or will it always be
obviously the latter is what I'd be looking for
Hi Stefan,
The concurrency-group property is not supported in stages at the moment. I can create a feature request for that if you'd like, please feel free to let me know.
Let's assume a deployment stage with two steps. If you take these two steps out of the stage, you won't be able to use the deployment keyword in both steps. A workaround would be to use the environment keyword along with concurrency-group. Any environment variables will be available to both steps because of the environment keyword. Please keep in mind though that you won't be able to track deployments in the Deployments page of the repo (I mean from the Deployments option on the left sidebar, while viewing a repo on Bitbucket's website).
A sample yml for this would be the following:
image: atlassian/default-image:5
pipelines:
default:
- step:
name: 1st Step
environment: Staging
concurrency-group: build-group
script:
- echo "This is step 1"
- step:
name: 2nd Step
environment: Staging
concurrency-group: build-group
script:
- echo "This is step 2"
With regards to the order the steps are executed with the concurrency-group, Pipelines follows a first-in-first-out order based on the order the steps start running. If we assume a yml file like the one I shared above, let's say you trigger Pipeline 1.
Please feel free to let me know if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.