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

How to use bitbucket pipelines with tag versions?

Rebase April 3, 2018
pipelines:
tags:
master/*.*.*-rc.*:

That should match master branch tagged with 1.2.3-rc.1, right?

2 answers

1 accepted

4 votes
Answer accepted
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2018

Hi Greg,

To set up tag builds, you don't need to specify the branch the tag is from.

So you can set up a tag build off of 1.2.3-rc.1 like this, for example:

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

 You should also be able to shorten this if you're just interested in release candidate builds:

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

A tag pipeline will only be triggered when a new tag is pushed (and matches an existing pipeline definition).

Thanks,

Phil

MiguelQueiroz July 17, 2023

About this, i have commits to master with tags, those should go to pipeline and build, but if the commit even with tags goes to "staging" branch, then this would be accepted as "master" build. This is the issue. 

 

Is there a way to say "Pipeline trigger with Tag on branch master only" ?

0 votes
Savvy_Webmaster
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!
September 13, 2018

Hi There,

 

I have this pipeline config as follow:

image: php:7.0.31

pipelines:
  tags:
    release-*:
      -step:
        name: Rebuild and release
        script:
           - #do something

 

And I get the following error: "The 'release-*' section in your bitbucket-pipelines.yml file must be a list."

 

May I please ask how to resolve this? 

 

Thanks.

Maximilian Schmitt
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!
August 12, 2019

You have to put the tag-pattern into single quotes like:

'release-*'

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events