Embed a Date into a Build Artifact

I have a build plan that produces a zip file as an artifact. Right now, it is called build.zip. I was wondering if it possible to name it based off the Date or Rev of the build such as build_01_19_18_rev12345.zip. I wanted to try to help avoid people mixing up builds, since currently their download folder will just have a series of generic build.zip files.

1 answer

You can achieve this by facilitating Bamboo variables in the build step that produces the artifact, in particular you likely want to use ${bamboo.buildTimeStamp} and/or ${bambooBuildNumber}.

The specifics depend on the build step you are using to produce the artifact, but all Bamboo tasks including the Script task should support the required variable substitution at build time just fine - the examples for Maven ant Ant illustrate the general concept.

Thanks for the response. Is there any way to set the value of a bamboo variable from within a script? Or do some string manipulation of other bamboo variables? Example, could I just get the date without the time.

Yes, but only with an indirection - you can manipulate the variable values in a script, write them to a file, and then inject them again as new variables by means of one of the following tasks:

You can then refer to the newly injected variables from subsequent tasks.

Awesome thank you very much.

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
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,792 views 0 6
Read article

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