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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,465,034
Community Members
 
Community Events
176
Community Groups

Share java spec commit id with generated build plan

I have a configuration of a repository with a java build spec and multiple other repositories with source code. The build specs generate similar build plans for each repo.

I want to have traceability between the build results of each repo and the version (e.g. the commit id) of the build spec used to create the build plan.
How to realize this traceability?

I was thinking of setting a plan property when the buildspec is run, but how to retrieve its commit id?

Another starting point would be to somehow add a build step, querying the last successful build of the java spec.

1 answer

1 accepted

1 vote
Answer accepted

Hello @Erwin K_, welcome to Atlassian Community!

You can use the bamboo.planRepository.<position>.revision variable to retrieve the revision id for that commit. The <position> starts on 0 and depends on how your Specs repository is ordered on the Plan.

To automate that, you can script something that would scan all environment variables named bamboo.planRepository.<position>.<name>, where <name> is your Specs repository, then strip the <position> from it and reuse it as the <position> on bamboo.planRepository.<position>.<revision>.

Optional: Once you have the revision you can create a text file with the variable=value format and reuse it across multiple Jobs if required:

 

Kind regards,

Eduardo Alvarenga
Atlassian Support APAC

Thanks this has been useful!
Previously I only had the code repo linked to the plan. By adding the specs repo to the plan as well, it can be accessed to retrieve the last commit.

Like Eduardo Alvarenga likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events