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

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
Community showcase
Published in Bamboo

Unable to add or edit Bitbucket Cloud repository in Bamboo

On 31 May, a GDPR-related change went live in the Bitbucket Cloud API that resulted in users not being able to create or edit Bitbucket Cloud Linked repositories in Bamboo. This API update removed t...

659 views 2 7
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