Missed Team ’24? Catch up on announcements here.

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

bitbucket-pipelines.yml on different branches

Deleted user August 3, 2018

Is it possible to run bitbucket-pipelines.yml  on custom branch? E.g. for testing I dont want to push onto master, but would like to prepare configuration on new branch and then merge. 

2 answers

3 votes
Deleted user August 3, 2018

Hi, thanks for the answer. But still I guess you have to push this yaml to master branch and pipelines will use it for building other branches?

Current solution is pushing yaml to selected branch with default steps and executing it via right menu on page with all the branches. 

image.png 

1 vote
Steve Thornhill
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 3, 2018

You can set the yaml file to provide different actions on each branch, I've pasted the example from the documentation below

 

image: node:4.6.0
  
pipelines:
  default:
    - step:
        name: Build and test
        script:
          - npm install
          - npm test
  tags:                         # add the 'tags' section
    release-*:                  # specify the tag
      - step:                   # define the build pipeline for the tag
          name: Build and release
          script:
            - npm install
            - npm test
            - npm run release
  branches:
    staging:
      - step:
          name: Clone
          script:
            - echo "Clone all the things!" 

https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events