Sarathlal N

Trigger Bitbucket pipeline based on commits in specific branch or specific tag

Trigger pipeline based on commits in specific branch

pipelines:
  branches:
    master:
      - step:
          script:
            - echo "master"
    develop:
      - step:
          script:
            - echo "work"

If we have to do same jobs for multiple branch, we can use a list of branch names. Note that there is no empty spaces in the list of branches!

pipelines:
  branches:
    '{master,develop,feature}':
      - step:
          script:
            - echo "master, develop or feature"
    work:
      - step:
          script:
            - echo "work"

Trigger pipeline based on tag

pipelines:
  tags:
    '*':
      - step:
          name: "Preparing bash to scripts"
          script:
            - echo $BITBUCKET_TAG

The $BITBUCKET_TAG is the default variable availe in pipeline.

Trigger pipeline based on release candidate tag

For our release canditate, we will add a tag with format like [our-version-number]-rc[increment]. An example is 2.9.3-rc1 etc.

pipelines:
  tags:
    '*-rc*':
      - step:
          script:
            - echo "My tag build"

Looking for a skilled WordPress/WooCommerce developer? I'm currently available for freelance, contract, or full-time remote opportunities! Let's create something amazing together. Send me a quick message, and I'll respond within 24 hours!

Recent Posts

  1. Understanding the Singleton Pattern and Using Traits to Achieve Singleton in WordPress Plugin Development
  2. REST API Methods Explained with Best Practices for Building Clean and Secure APIs
  3. My 28-Day Plan to Master Modern WordPress Development Using AI Tools
  4. Scaling WordPress - How Custom Database Tables Solve the Post Meta Bottleneck
  5. WordPress Transients Explained - A Developer's Guide to Site Performance

Your Questions / Comments

If you found this article interesting, found errors, or just want to discuss about it, please get in touch.