Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Parallel steps config not followed

Rishabh Gupta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 2, 2024

 

I have the foll. bitbucket-pipelines.yml:

image: gradle:7.6

definitions:
git_tag: &git_tag
name : "git_tag"
script:
- pipe: docker://onequince/quince-build-pipeline:latest
variables:
VERSION: ${BITBUCKET_BUILD_NUMBER}
COMMAND: 'gitTag'
services:
- docker
after-script:
- pipe: docker://onequince/notifications:latest

security: &security
name : "security"
script:
- echo "Running security scan"
- pipe: docker://onequince/quince-security-pipeline:latest
variables:
VERSION: ${BITBUCKET_BUILD_NUMBER}
services:
- docker
after-script:
- pipe: docker://onequince/notifications:latest

docker_build: &docker_build
name : "docker_build"
caches:
- gradle
services:
- docker
script:
- echo "Building and pushing docker image"
- bash ./gradlew build -i
- apt-get update -y && apt-get install -y python3-pip && pip3 install --upgrade awscli
- aws ecr get-login-password --region us-west-1 | docker login --username AWS --password-stdin 526019940306.dkr.ecr.us-west-1.amazonaws.com
- pipe: docker://526019940306.dkr.ecr.us-west-1.amazonaws.com/quince-build-pipeline:1.2.2
variables:
ENV: 'stage'
COMMAND: 'buildPush'
NAME: 'Build & Push to ECR'
ECR_REPOSITORY: ${SERVICE_NAME}
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
after-script:
- pipe: docker://onequince/notifications:latest
artifacts:
- build/reports/jacoco/test/jacocoTestReport.xml

sonarqube_analysis: &sonarqube_analysis
name : "sonarqube_analysis"
script:
- pipe: sonarsource/sonarqube-scan:1.0.0
variables:
EXTRA_ARGS: -Dsonar.java.binaries=.
SONAR_HOST_URL: ${SONAR_HOST_URL}
SONAR_TOKEN: ${SONAR_TOKEN}
services:
- docker
after-script:
- pipe: docker://onequince/notifications:latest

eks_deploy: &eks_deploy
name : "eks_deploy"
script:
- pipe: docker://onequince/deploy:latest
variables:
NAME: 'Deploy Helm Chart'
RELEASE_VERSION: ${BITBUCKET_BUILD_NUMBER}
CHART_NAME: ${CHART_NAME}
REPO_NAME: ${SERVICE_NAME}
ECR_REPO: ${ECR_REPO}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}
ARGOCD_AUTH_TOKEN: ${ARGOCD_AUTH_TOKEN}
ARGOCD_PROD_AUTH_TOKEN: ${ARGOCD_PROD_AUTH_TOKEN}
ENV: ${ENV}
services:
- docker
after-script:
- pipe: docker://onequince/notifications:latest

pipelines:
branches:
"**":
- step:
name: "Git Tag"
<<: *git_tag
- parallel :
fail-fast: true
steps:
- step:
<<: *security
name: "Security Scan"
- step:
<<: *docker_build
name: "Docker Build"
- step:
name: Dev Deploy
trigger: manual
deployment: Staging
<<: *eks_deploy
- step:
name: Integ Deploy
deployment: Integration
trigger: manual
<<: *eks_deploy
master:
- step:
name: Git Tag
<<: *git_tag
- parallel :
fail-fast: true
steps:
- step:
<<: *security
name: "Security Scan"
- step:
<<: *docker_build
name: "Docker Build"
- step:
<<: *sonarqube_analysis
name: "Sonarqube Analysis"
- step:
name: Integ Deploy
deployment: Integration
trigger: manual
<<: *eks_deploy
- step:
name: Prod Deploy
deployment: production
trigger: manual
<<: *eks_deploy

custom:
hotfix-deployment:
- variables:
- name: HOTFIX_BRANCH
default : master
- name: ENVIRONMENT
default: Integration
allowed-values:
- production
- Integration
- stage:
name: Production Hotfix Deployment
deployment: $ENVIRONMENT
steps:
- step:
name: Deploying Hotfix to $ENVIRONMENT
script:
- pipe: docker://onequince/notifications:latest
- parallel :
fail-fast: true
steps:
- step:
name: Integ Deploy
deployment: Integration
trigger: manual
<<: *eks_deploy
- step:
name: Prod Deploy
deployment: production
trigger: manual
<<: *eks_deploy

For PRs on the release branch, these are the steps:

 

"release*":
  - step:
      name: "Git Tag"
      <<: *git_tag
  - parallel :
      fail-fast: true
      steps:
        - step:
            <<: *security
            name: "Security Scan"
        - step:
            <<: *docker_build
            name: "Docker Build"
  - step:
      <<: *sonarqube_analysis
      name: "Sonarqube Analysis"
  - step:
      name: Dev Deploy
      deployment: Staging
      trigger: manual
      <<: *eks_deploy
  - step:
      name: Integ Deploy
      deployment: Integration
      trigger: manual
      <<: *eks_deploy

According to this the "Sonarqube Analysis" step shouldn’t be running in parallel but in the PR, it’s running in parallel:

Screenshot 2024-07-02 at 9.07.34 PM.png

This used to work properly before. I'm facing the same in other repos as well.

 

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2024

Hi Rishabh and welcome to the community!

If the indentation in the yml is the same as in the examples you posted there, this shouldn't occur.

I suggest checking locally the indentation of the step "Sonarqube Analysis" step and ensuring it's at the same level as the - parallel: keyword. Please also ensure that spaces are used for indentation and not tabs in the yml. If this occurs with the PR pipeline, you'll need to check the yml at the source branch of the PR. If it's a branch pipeline, please check the yml on this branch.

If you still cannot figure it out, you can create a ticket with the support team and share the URL of a build where this issue occurs for further investigation. You can create a ticket via https://support.atlassian.com/contact/#/, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. When you are asked to provide the workspace URL, please make sure you enter the URL of the workspace that is on a paid billing plan to proceed with ticket creation.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events