Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Run custom pipeline with specific tag Edited

Hello Community,

my scenario is as follows: 

1) I would like to run a pipeline on a user specified tag. 

I've set up a custom pipeline with an input variable, requiring to enter a tag version (TAG_VERSION) to run the build on.

As far as I can see, the pipeline initially checkouts out the full branch, so therefore I added a this line as a step:

- git fetch --all --tags && git checkout $TAG_VERSION -b $TAG_VERSION

 

This seems to be superfluous, if I could initially set the pipeline's checkout command to perform the checkout only on TAG_VERSION.

2) Is it possible to provide a Dropdown "Run Pipeline" (instead of a plain text field) in the input field showing all available tags ?  

 

Thank you for your support!

1 answer

0 votes

Hi Andreas,

Custom builds run on a detached head. They do not run on a specific branch, therefore there will be no checkout to any branch. If you need to create and checkout to a branch, you'll need to use a command like the one you posted here.

The variables used in custom builds allow the user to give any input, I'm afraid that it is not possible to specify a dropdown for a variable with all available tags, or any user defined values. If you'd be interested in that, you are more than welcome to open a feature request for this in our issue tracker https://jira.atlassian.com/secure/Dashboard.jspa for our product managers to take into account, or I can open it also for you, just let me know!

Kind regards,
Theodora

Hello Theodora,

thank you for your message.

As for Question 1:

In order to ensure my custom build to run on the correct branch (master), should I actually have to put the command in front of 

- git checkout master && git fetch --all --tags && git checkout $TAG_VERSION -b $TAG_VERSION

As far as I understand "Detached Head", it's checked out on a commit...

And for Question 2, yes please open a feature request for this, thank you!

 

Kind regards,

Andreas   

Hi Andreas,

Since custom builds will run on a specific commit, they will not be associated with a branch. What I mean by that is that if you go the Pipelines page of the repo, and select the master branch, you will not see any custom builds that were run on commits of master.

The command you included in your reply first checks out master branch but then creates and checks out a new branch. Whether you need to checkout/create a branch depends on what operations you do during your build and whether you need those branches. Do you need both master and a new branch on the tag during your build?

If you don't need these branches and you want to run a custom build on a tag, you can search for the commit with this tag in the Commits page of the repo and run the custom build on this commit. Then the checkout happens on the commit with this tag.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

503 views 6 4
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you