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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,559
Community Members
 
Community Events
185
Community Groups

Pipeline Tags globing pattern

Hi all, 

I am currently trying to trigger application deployment on tag. 

Everything is ok when I follow the pattern "foo-*" .

However I'd like to follow semversioning on my app (1.2.3-beta).

So I put the following pattern: 

+([0-9]).+([0-9]).+([0-9])-beta*

Doing so, the trigger does not work. 

Am I missing something. 

Does the pattern matching depends on the image we specify in the yml ?

Here is the complete section of the yml. 

tags:  # {staging, stable, prod} environments deployment are triggered on tag only
    +([0-9]).+([0-9]).+([0-9])-beta*:
      - step:
          script:
          - mvn -B -s settings.xml clean install -P staging
          - cd endpoints-api
          - echo ${GOOGLE_CLIENT_SECRET} > client-secret.json
          - gcloud auth activate-service-account --key-file client-secret.json
          - version=$(echo ${BITBUCKET_TAG} | tr . -)
          - mvn -B -s ../settings.xml appengine:deploy -Dapp.deploy.version=$version -P staging
    +([0-9]).+([0-9]).+([0-9])-rc*:
      - step:
          script:
          - mvn -B -s settings.xml clean install -P prod
          - cd endpoints-api
          - echo ${GOOGLE_CLIENT_SECRET} > client-secret.json
          - gcloud auth activate-service-account --key-file client-secret.json
          - version=$(echo ${BITBUCKET_TAG} | tr . -)
          - mvn -B -s ../settings.xml appengine:deploy -Dapp.deploy.version=$version -P prod -Dservice_name=stable -Dtemplate_file_id=1Kiv3stWFWsoCBnRFWfIfZ2VUNTk__12n9vevQF4AtPk
    +([0-9]).+([0-9]).+([0-9]):
      - step:
          script:
          - mvn -B -s settings.xml clean install -P prod
          - cd endpoints-api
          - echo ${GOOGLE_CLIENT_SECRET} > client-secret.json
          - gcloud auth activate-service-account --key-file client-secret.json
          - version=$(echo ${BITBUCKET_TAG} | tr . -)
          - mvn -B -s ../settings.xml appengine:deploy -Dapp.deploy.version=$version -P prod

Note, I replace the . by - because the version name cannot contain '.' in google appengine app. 

 

Thx for your help.

1 answer

1 accepted

1 vote
Answer accepted
SebC
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 22, 2017 • edited

There's no regex support for tags/branches, it's all simple globs - see https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html#Configurebitbucket-pipelines.yml-globbing_patternsGlobpatternscheatsheet for examples.

 

what would happen if you followed the patterns?:

*-beta*:

*-rc*:

default:

It's what iI finally did.

Examples are good but how about the spec? Does it support "?", "extglob" patterns as  bash does?

Nick Reilingh
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.
Dec 21, 2022

You can do `shopt -s extglob` in a single script step -- this will affect subsequent script lines and allow you to use extglob.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events