Bamboo Tag Trigger for Multiple Repositories.

fnc11 January 20, 2023

I am working on a task where we want to create a release branch from the master, as soon as a release tag is pushed to the master branch. This process is working for a single repository.

Now I want to include multiple repositories in this plan, and based on the tag pushed to the master branch of one of the repositories I want to create a release branch for that repository. And do some further tasks if necessary, like removing -SNAPSHOT in case of maven projects.

So I have the following questions:

  1. First how to make tag trigger work for multiple repos.
  2. I am thinking that this is the only option to retrieve the repository name for which the plan got triggered. If there is any simpler way, please let me know.
  3. Retrieving tag also.
  4. Since the plan has multiple repos, how the tag trigger will work if I release v1.3 for repo1 and later v1.3 for some other repo2. I ask this since the tag trigger only works for new tags.

1 answer

0 votes
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 20, 2023

Hello @fnc11

You are on the spot!

We have a KB article that explains pretty much that community post you have referred to:

To find the last tag of a repository you can run after checking it out:

git describe --tags --abbrev=0

Regarding multiple similar tags across different repositories, as long as they are new but have different revisions on different repositories, Bamboo will identify them all and trigger the builds.

Kind regards,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

fnc11 January 20, 2023

Thanks @Eduardo Alvarenga , but this is not the complete solution. The tag trigger is not working for all the repositories. It's working only for the default repository.

And what I meant by retrieving tag, is to have it as a variable in the build, to be used for release branches like release/1.3. 

And while we are on the topic, is it possible to have one default job which gets activated to identify the repo and tag and then runs different jobs on the basis of that information?

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 20, 2023

Hey @fnc11 apologies for that. You are right. Tag triggers will only work on the default repository.

I would suggest you create individual Plans that would be used exclusively as "Launchers" and add individual "default" repositories on each of them along with a Tag trigger.

Then, once Bamboo detects the new tag on a repository, it will start a "launcher" build that can trigger the "real" plan -- that "real" plan doesn't need to have any configured triggers as it will always be invoked by the "launcher" plan.

To trigger a Plan from another Plan, the "Launcher" plan can make use of Dependencies (Child Plan) or REST API calls over a Script Task to trigger the plans independently (that's a good case if you need to pass build parameters to that plan such as variables, specific stages, custom revision, etc.

Variables can be injected by an "Inject Bamboo variables" task within a Job. Those variables need to be loaded from a java properties file (key=value format). So you can run a command to extract the tag name you need, add it to a file tag=value and call another Inject Bamboo variables task to load it as a variable and pass it over to the next task or Stage (if applicable).

Cheers,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Like Steffen Opel _Utoolity_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events