Hi all,
I have a pipeline in repo_A that is triggered when changes are pushed in repo_B and/or repo_C.
When it is triggered by just one repo (B or C) it's all fine and everything works.
When I push change in the two repos whining short time (e.g. I push changes in repo_C two minute after repo_B while the pipeline in repo_A is already running) things goes wrong.
Is there a way for example to stop the first running once the second is triggered and run only the second? Or create a kind of queue?
Hope my question make sense.
Thanks for your help.
I'm afraid that it is not possible to stop the first one running and then run the second one. There is a way to work around this issue, I am sharing more details below:
You could make use of the deployment keyword in the bitbucket-pipelines.yml file of repo A. In case the pipeline in repo A has multiple steps, you could combine them into one step and then add the deployment keyword to that step with one of the environments defined in the repo A Repository settings > Deployments. You can find more details here.
If a deployment step is already running on repo A when another one is triggered, then the second one will be automatically paused. Please keep in mind though that it is not possible to resume the paused ones automatically. A paused deployment can be manually resumed once the in-progress deployment completes.
In case you trigger the builds in repo A by using the atlassian/trigger-pipeline in repo B and repo C, and you use the variable WAIT in the pipe with value true, please keep in mind that a build in repo B and repo C will fail if the deployment step that it triggers in repo A gets paused (with an error message that the build in repo A is halted).
Is this something that would work for you? Please feel free to let me know if you have any questions.
I also wanted to let you know that we have feature requests for automatically resuming paused deployments as well as building concurrency control for non-deployment steps.
Kind regards,
Theodora
thanks for your reply.
I solved the problem by
making the pipeline in repo_b and repo_c like this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for your reply.
I solved the problem by
making the pipeline in repo_b and repo_c like this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Domenico,
Thank you for the update and for sharing your script here, it's good to hear that this works well for you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.