Gelin Luo
Gelin Luo

Reputation: 14373

How can I setup a trigger in Bamboo if there is a specific tag been pushed to my bitbucket repository

I am trying to use bamboo to manage my release procedure and just wondering if this is feasible:

  1. The developer finished the integration test at local environment
  2. The developer create a specific tag, e.g. "UAT_1.0.0" and pushed the tag to bitbucket
  3. Bamboo sensed that there is an new tag "UAT_1.0.0" has been created on bitbucket and then start the building process; after that it will deploy the war file to the UAT server
  4. Tester signed off the UAT and created a tag "REL_1.0.0" and pushed the tag to bitbucket
  5. Bamboo sensed the new tag "REL_1.0.0" and start the building process. After build finished, it deploy the war file to the PROD server

It looks like the "Repository triggers the build when changes are committed" is to best way to implement the process. But I can't find out the way to move any further. Any idea?

Upvotes: 3

Views: 2255

Answers (2)

Jonathan Etchepare
Jonathan Etchepare

Reputation: 1

A bit late but... I found a solution. You need to put a "negative" regular expression in the "Exclude changesets" section in the repository configuration, that include the word that you want. The regular expression is like :

^(?!.test).$

like that: repository configuration

with this, bamboo will only build commits with this word in the message. Now, if your commit is like "commit for test", bamboo will build it

Upvotes: 0

JaDogg
JaDogg

Reputation: 1313

Yes you can do this (Only if you can deploy custom plugins to it).

You need to build custom triggers as plugins for bamboo.

  1. Get/Install the SDK
  2. Create a plugin. See here. If you have access to bamboo's source code I suggest you look into classes DependencyTriggerReason, InitialbuildTriggerReason, ScheduledTriggerReason. You need to create a class implementing TriggerReason. You should start with this tutorial if you are new to developing bamboo plugins.

  3. Deploy it to bamboo.

Upvotes: 2

Related Questions