I would like to specify the bitbucket build Id that appears when running the pipeline into my bitbucket pipeline file as a tag for the version that will be released from bitbucket.
It is very important for us can you help us?
Thank you for reaching out to Atlassian Community!
Pipelines provides a set of default variables that are available for builds and can be used in scripts.
It’s possible to get the build number by using the BITBUCKET_BUILD_NUMBER variable:
The unique identifier for a build. It increments with each build and can be used to create unique artifact names.
You can also find more default variables in this documentation:
I hope this helps, but please let me know if you face any obstacles.
Could you confirm if you want to run the Pipeline on a Tag or would like to create a Tag?
The reason I’m asking this is that in the original question, you asked to create a tag. If this is what you need, you can run the following:
git tag $BITBUCKET_BUILD_NUMBER
Looking forward to hearing from you.
Hi, Fatma! :)
In this case, you need to add a section on your .yml file to run the pipelines on tags:
tags: # add the 'tags' section release-*: # specify the tag - step: # define the build pipeline for the tag name: tags script: - echo $BITBUCKET_BUILD_NUMBER
In the example above, all the tags that start with "release-" will trigger this pipeline.
In case you would like to read more about how to configure the bitbucket-pipelines.yml, you can access the following link:
Please let me know how it goes and feel free to share any additional questions regarding this case.
Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...
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