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

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.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

28,606 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you