Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Is it possible to create an artifact name based on a variable

Is it possible to create an artifact name based on a variable, like bamboo.build.planName or bamboo.jira.version and so on.

 

Thanks in advance

1 answer

1 vote

Hi Beck,

When you say "artifact name based on a variable", Are you talking about the file itself or use variables in the artifact definition page?

Artifact file:

As variables will be available at agent's environment while the build is running, you can use them in your tasks to produce your artifacts.

Very simple example:

If you want to create a "planKey-buildNumber.txt" file and write "hello world" into it, you just need to add a script task with the following inline script:

echo hello World > ${bamboo.planKey}-${bamboo.buildNumber}.txt

The same syntax can be used anywhere inside your build.

You will find more examples in the "Bamboo variables" documentation.

Artifact Definition:

Yes, you can use variables at the artifact definition fields, the only thing that you must pay attention is to do not use Build-specific variables (like ${bamboo.buildNumber}) in the "copy pattern" field, as these variable are evaluated by Bamboo dynamically at build time, you may face problems if you decide to use the artifact in another plan and/or deployment.

Please let me know if this answers your question.

cheers.

Suggest an answer

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

Bamboo Data Center - Early Access Program 2

We’re preparing for Bamboo 8.0, which will be our first Data Center release. To make sure our app vendors and customers with written in-house apps are prepared, we’re launching Bamboo 8.0 Early Acces...

91 views 0 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