bitbucketpipelinebitbucket-pipelines

Can I execute a pipeline from other pipeline in bitbucket pipelines?


I has the two repositories in bitbucket pipelines, both with pipelines enable.

How to execute the pipeline after the other pipeline complete?


Solution

  • Use "Bitbucket trigger pipeline" pipe in your pipeline's final step. You can easily setup this pipe:

    script:
      - pipe: atlassian/trigger-pipeline:4.1.5
        variables:
          BITBUCKET_USERNAME: $BITBUCKET_USERNAME
          BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
          REPOSITORY: 'your-awesome-repo'
    

    Where variables:

    $BITBUCKET_USERNAME - Bitbucket user that will trigger the pipeline. Note, that this should be an account name, not the email.

    $BITBUCKET_APP_PASSWORD - Bitbucket app password of the user that will trigger the pipeline. Remember to check the Pipelines Write and Repositories Read permissions when generating the app password.

    This pipe will trigger the branch pipeline for master in your-awesome-repo. This pipeline will continue, without waiting for the triggered pipeline to complete.