Hello team !
We are evaluating various managed CICD vendors including Bitbucket pipelines for our deployment. Bitbucket Pipelines has a higher preference in our category as we are already using Bitbucket for our code. Our current provider for CICD pipeline is Jenkins. Please help us with one of our blocker. I will explain our use-case and blocker below.
We have two kind of deployment for our applications for each build -
We have been successfully able to migrate our Full Deployment logs to Bitbucket Pipelines which works reasonably fine. However, with the existing constructs, I fail to understand how can I achieve Hot Deployments. Let me share what all I have looked into :
- step: &Deploy-to-dev
name: 'š Deployment - š» Dev'
deployment: dev
trigger: manual
script:
- ./full_deployment.sh dev
- step: &HotDeployment-Pkg1-to-dev
name: 'ā”ļøHot Deploy Pkg1 - š» Dev'
deployment: dev
trigger: manual
script:
- ./hot_deploy.sh dev Pkg1
But with this I see following issue
The deployment environment 'dev' in your bitbucket-pipelines.yml file occurs multiple times in the pipeline. Please refer to our documentation for valid environments and their ordering.
Any help on the matter would be greatly appreciated.
Hi Siddharth and welcome to the community!
Steps of the same pipeline need to be executed sequentially. There is no option to skip a specific step; we have a feature request that you can vote for here: https://jira.atlassian.com/browse/BCLOUD-20833
You can work around this issue in one of the following two ways:
1st Option
Create two deployment environments instead of 1, named e.g. dev1 and dev2. The environments need to be of the same type for this solution to work (e.g. they both need to be under Test environments, or under Staging environments or under Production environments)
You can then make these two deployment steps parallel and manual, see below an example:
pipelines:
default:
- step:
script:
- echo "Build and Test"
- parallel:
steps:
- step:
deployment: dev1
trigger: manual
script:
- echo "This is dev1 deployment"
- step:
deployment: dev2
trigger: manual
script:
- echo "This is dev2 deployment"
I didn't use YAML anchors here, but this will also work with YAML anchors. Since the steps are parallel and manual, you can select which one to run.
Please keep in mind that if you have another step after the parallel set, then both parallel steps will need to be completed for the pipeline to run the next step.
Since two deployment environments are used, there will be no concurrency control. This shouldn't be an issue if each step deploys to a different machine, but it might be an issue if both steps deploy to the same machine and run at the same time.
2nd Option
You can use a separate custom pipeline for each of the deployment steps:
Custom pipelines do not run automatically. They can be triggered manually or on schedule. You can see the different ways to trigger custom pipelines here:
Please feel free to let me know if you have any questions!
Kind regards,
Theodora
Thanks Theodora for your response and the welcome :)
Option two was something that had also crossed my mind, but option one could be interesting workaround for my case till the feature you mentioned is planned out.
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.