How to obtain status execution from Bitbucket trigger pipeline?

MHelena L_ Chaves
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!
October 30, 2024

Hi! 

I'm trying to use Bitbucket trigger pipeline to implement GitOps and I need to verify status execution after a call to pipe atlassian/trigger-pipeline:5.8.1. 
I set WAIT parameter to 'true' hoping that it would break my script but not!
Do you have some suggestions?
Thank you in advance!
My script:
    - step: &update-environment
        script:
          - |
              export ENVIRONMENT="$BITBUCKET_DEPLOYMENT_ENVIRONMENT"
              export IMAGE_TAG=$(git tag --points-at HEAD --sort=-creatordate | head -n 1)
              [[ -z "$IMAGE_TAG" ]] && IMAGE_TAG=${BITBUCKET_COMMIT:0:5}
              echo "IMAGE_TAG=$IMAGE_TAG"
          - pipe: atlassian/trigger-pipeline:5.8.1
            variables:
              BITBUCKET_ACCESS_TOKEN: $GIT_ADMIN_TOKEN
              REPOSITORY: 'sbx-gitops'
              REF_NAME: 'main'
              DEBUG: 'true'
              WAIT: 'true'
              CUSTOM_PIPELINE_NAME: 'update-gitops'
              PIPELINE_VARIABLES: >
                [
                  {"key": "ENVIRONMENT", "value": "${BITBUCKET_DEPLOYMENT_ENVIRONMENT}"},
                  {"key": "COMPONENT", "value": "${BITBUCKET_REPO_SLUG}"},
                  {"key": "IMAGE_TAG", "value": "${IMAGE_TAG}"}

1 answer

2 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 31, 2024

Hello @MHelena L_ Chaves ,

Just adding to @iub fun's response, according to the atlassian/trigger-pipeline  pipe's documentation, adding the WAIT flag should make the current pipeline fail if the external pipelines also fails : 

WAIT:  Flag to wait until the triggered build finishes. Default: false. If set to true, this pipe will wait for the triggered pipeline to complete. If the triggered pipeline fails, this pipe will also fail.

 

Could you please confirm if the externally triggered pipeline failed while the current pipeline (the one containing the pipe) has not?

Thank you, @MHelena L_ Chaves !

Patrik S

MHelena L_ Chaves
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!
November 6, 2024

Hi Patrik, I think it was caused by the DEBUG option. Now it's working!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events