Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipeline triggered on branch creation

Gonzalo March 13, 2019

Hi,

I was wondering if it's possible to start a pipeline when a new branch (release/*) is created, not when there is a commit.

For example, If I create a new branch release/1.0.0 from develop using Bitbucket I would like to run my test suite on that branch without having committing anything.

 

Thank you very much 

2 answers

1 accepted

0 votes
Answer accepted
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2019

Hello,

As far as I understand this already happens, assuming that the branch has a bitbucket-pipelines.yml. Can you paste in an example of your bitbucket-pipelines.yml?

Thanks,

Phil

0 votes
Gonzalo April 11, 2019

Hi Philip,

Thanks for replying. You are totally right this is the way it works when you create the release branch locally and then you push it. But when I create the release on Bitbucket it won't trigger the pipeline.

Here is my bitbucket-pipelines.yml:

options:
docker: true
size: 2x


pipelines:
branches:
develop:
- step:
image: williamyeh/ansible:ubuntu18.04
deployment: staging
script:
- [things we do]

release/*:
- step:
image: [our image]
deployment: production
caches:
- composer
script:
- [things we do]
artifacts:
- tests/_output/**
- var/log/**



definitions:
services:
docker:
memory: 4096
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2019

Hmmm. I can't seem to reproduce this.

Here's what I'm doing. Maybe something stands out as different to you?

I have the following bitbucket-pipelines.yml on my master branch.

pipelines:
branches:
test*:
- step:
script:
- echo hello

I then click on the Branches sidebar icon.

Screen Shot 2019-04-11 at 6.34.50 pm.png

And then 'Create Branch'.

Screen Shot 2019-04-11 at 6.34.56 pm.png

I call the new branch "test-branch-name".

Screen Shot 2019-04-11 at 6.35.17 pm.pngScreen Shot 2019-04-11 at 6.35.30 pm.png

And then see that a new pipeline is running on that branch.

Screen Shot 2019-04-11 at 6.35.40 pm.png

Does anything there look different to what you're doing?

Gonzalo April 11, 2019

Hey, I've just tested it and you are right again. Its working as expected. Maybe at the beginning I was testing it wrong :p

 

Thank you very much for your time 

sunisgcet October 20, 2019

i can manually create a branch on jira using same issue name. but i need to automatically create branch on bitbucket using the same issue name jira. can anyone help me this .

i tried commit created trigger it works but in that  how can i execute branch created trigger. in which transition i can use that branch created trigger and how can i configure it. if you know any reference links means please let me know.

simply i need to create issue per branch on the existing repo or i need to create issue per repo.

thanks advance.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events