Forums

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

Bitbucket pipeline only work if there is any new commit.

Niket Chandrawanshi
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!
July 21, 2019

Hi Team,

I am trying to figure out the process for the pipeline, I already schedule my pipeline for a certain time frame, but now I want to execute that particular pipeline only when there is any new commit to that particular branch. Otherwise, the pipeline will on hold.

Currently, what is happing in my pipeline it will get execute on its scheduled time, no matter any changes are there or not on a particular branch! That creates a problem is so many ways.

  • Storage
  • Backups management
  • Memory Usage

How can we do that?

1 answer

0 votes
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2019

Hi @Niket Chandrawanshi

I guess the document that will provide you with the most meaningful information to understand pipelines structure is this one:


Let me share some examples that can be used as a reference so you know what are the changes you need perform in your configuration:

1) This is an example of a configuration that will only trigger builds in master and develop.

pipelines:
  branches:
    master:
      - step:
          script:
            - echo "Trigger when there is a commit in master branch"

    develop:
      - step:
          script:
            - echo "Trigger when there is a commit in develop branch"

2) If your bitbucket-pipelines.yml have the following configuration, every commit will trigger a build. Any branch with this definition will trigger when a new commit arrives.

pipelines:
  default:
    - step:
        script:
            - echo "Triggers on every commit"

Please let me know if they are helpful. Please also check the document shared above and let me know if you have any questions on this matter.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events