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

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Get revision number from artifacts from another job

Dear Community,

I created a buildjob that uses artifacts from two different buildjobs A and B (therefore, has no own repository). The job itself creates an artifact C that I want to upload to Artifactory (the binary version control tool). So, now I want to create properties that link directly to the revision number of the artifacts. In the buildjobs a and b that create A and B, it can be easily accessed with ${bamboo.repository.revision.number}. However, since I do not checkout any repo and only use the artifacts via the sharing artifact option:

https://confluence.atlassian.com/bamboo/sharing-artifacts-359400060.html

the revision.number variable is not an option.

Do you have any suggestions how to get to the required commit hash?

Thx for your help,
kind regards

1 answer

You could propagate the ${bamboo.repository.revision.number} variable by means of a secondary artifact and the Bamboo Variables task, roughly: 

  1. Dump the variable to a properties file via the Bamboo Script task in plans A and B, i.e. (from the top of my head) something like:
    • 'echo "plan1hash= $bamboo_repository_revision_number" >plan1.properties' for Bash
  2. Share the two property files as secondary artifacts with plan C
  3. Download  the secondary artifacts from plan A and B in plan C
  4. Inject new variables from the two property files in plan C with the Bamboo Variables task
  5. Use the two commit hashes by consuming the variables in your Artifactory upload

Suggest an answer

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

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

673 views 1 6
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