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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.