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?
Hi, @fatma.elbehi!
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:
Variables and secrets
I hope this helps, but please let me know if you face any obstacles.
Kind regards,Caroline
Hi,
yes I tried this solution and it works!
but now I want to add Tags in my pipeline with the branches but my script shows errors when adding the tags could you please help?
I tried this trick but I don't know if it's the correct syntax or not? v2.2.1 is the branch and for v2.2.7 represents the name of the tag.
Your help will be much appreciated! Thanks in advance!
Fatma
Hi, Fatma!
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.
It looks like you're new here. Sign in or register to get started.