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

Run the trigger pipeline to trigger other repo pipeline in both Repo's owned by a team

Abdul Rehman June 17, 2022

I have tried all the above mentioned steps still I am getting this error 

Status: Downloaded newer image for bitbucketpipelines/trigger-pipeline:5.0.0

DEBUG: Starting new HTTPS connection (1): bitbucket.org:443

DEBUG: https://bitbucket.org:443 "GET /bitbucketpipelines/official-pipes/raw/master/pipes.prod.json HTTP/1.1" 200 None

DEBUG: Starting new HTTPS connection (1): api.bitbucket.org:443

DEBUG: https://api.bitbucket.org:443 "POST /2.0/repositories/workspace-name/repo_name/pipelines/ HTTP/1.1" 404 61

✖ Account, repository or branch doesn't exist.

 

Bitbucket pipeline code in repo, from where I'm trying to trigger another repo in same TEAM workspace

master:

      - step:

          name: Preparing Dependencies

          script:

            - pipe: atlassian/trigger-pipeline:5.0.0

              variables:

                BITBUCKET_USERNAME: $BITBUCKET_USERNAME

                BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD

                REPOSITORY: 'repo_name'

                ACCOUNT: 'workspace-name' # Optional

                BRANCH_NAME: 'main' # Optional

                # REF_TYPE: '<string>' # Optional

                # REF_NAME: '<string>' # Optional

                # CUSTOM_PIPELINE_NAME: '<string>' # Optional

                # PIPELINE_VARIABLES: '<json>' # Optional

                WAIT: "true"

                # WAIT_MAX_TIMEOUT: '<string>' # Optional

                DEBUG: 'true' # Optional

I can confirm that the repo which I'm trying to get triggered, it's branch name is main 
And the branch from where I'm trying to trigger is master as clearly mentioned in the pipeline file above

Workspace Variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
This is my personal username

BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
This is also my personal app password which I created in my account setting 

I have admin access to the workspace of our team and I can merge pull commit in main branch of that repo


Please help me out if you need any additional details I'm willing to give you

 

Thanks
Abdul

 

1 answer

1 accepted

1 vote
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 20, 2022

Hello @Abdul Rehman ,

Thank you for reaching out to Atlassian Community!

The version 5.0.0 of the pipe atlassian/trigger-pipeline has decommissioned the variable  BRANCH_NAME, so in this case you will need to remove that variable from your syntax and add the following ones to replace it : 

REF_TYPE: '<string>' # The type of the reference to run the pipeline on. Can be branch or tag. Default branch.
REF_NAME: '<string>' # The name of the reference to run the pipeline on. Default master. It should be a branch name if the REF_TYPE is branch, it should be a tag name if REF_TYPE is tag

With that in mind, your YML file to trigger a branch named main in another repository would look like below : 

master:

      - step:
          name: Preparing Dependencies
          script:
            - pipe: atlassian/trigger-pipeline:5.0.0
              variables:
                BITBUCKET_USERNAME: $BITBUCKET_USERNAME
                BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
                REPOSITORY: 'repo_name'
                ACCOUNT: 'workspace-name'
                REF_TYPE: 'branch'
                REF_NAME: 'main'
                WAIT: "true"          
                DEBUG: 'true' # Optional

For more details about the available variables in the latest version of the pipe, you can refer to its official documentation  : 

Hope that helps! Let us know in case you run into any issues trying the suggestion above.

Thank you, @Abdul Rehman .

Kind regards,

Patrik S

Abdul Rehman June 21, 2022

@Patrik S Thank you so much for helping out really appreciated. You are right as I was using atlassian/trigger-pipeline:5.0.0 it has difference variables syntax which I have found from here as well Bitbucket trigger pipeline
Thanks
My issue Solved with your Answer @Patrik S 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events