Triggering build from EMS
Asked by elucify:

I created my first Bamboo plan 20 minutes ago, so it's hard to be newbier than me. Bamboo looks great.

I'm already wondering if we can trigger builds from an enterprise messaging system (EMS); for example, ActiveMQ (which Bamboo apparently uses internally) or RabbitMQ (which we've looked at but don't yet use.)

Any advice on that front? I know our scripts and build steps can use an EMS to send messages, but can Bamboo be configured to receive messages on a queue and start builds/send notifications via an EMS?

Thanks

Mark Johnson

Bethesda, MD


Answers:
author: TylerA
body: Hi Mark.

No, Bamboo cannot trigger builds from an instant message. The instant messaging platform provides only one-way communication from Bamboo.

comments: author: elucify
body: No, I don't mean instant messages. Obviously letting anyone in the world send messages to your pipelines is probably not the best idea.

I'm asking if there is a way (or where should I ask for a way) to trigger Bamboo tasks when messages are received from an enterprise message system like RabbitMQ or ActiveMQ (the latter, I believe, is used by Bamboo itself). <http://en.wikipedia.org/wiki/Enterprise_messaging_system>

Bamboo triggers processes to run either by a schedule, by messages received from a repository (build complete), or by polling the repository for changes. I'd like to extend that so Bamboo jobs could be triggered by messages occurring on an ESB. For example, some other process could fire a message at Bamboo via ActiveMQ saying "job complete", and include some data. Bamboo could treat that message as a "build request"; for example, to integrate the job just completed with some other data source. Currently the only way to initiate Bamboo is via a checkin or a clock tick. Bamboo would be much more useful if I could get it to run things in response to any enterprise event.


author: TylerA
body: Mark,

Please allow me to elaborate and clarify my response. [RabbitMQ](http://en.wikipedia.org/wiki/RabbitMQ) and [ActiveMQ](http://en.wikipedia.org/wiki/Apache_ActiveMQ), despite being "Enterprise Messaging Systems", still fall under the category of Instant Messaging platforms which are not trusted by Bamboo and treated as one-way notification pathways. As such, (Stock \& OnDemand) Bamboo will not allow builds to be triggered or processed via any of its notification systems.

If you were to write a script/program for Bamboo which leverages Bamboo's external API(s) or a plugin to act directly on its internals, then yes, you could certainly make Bamboo do what you've detailed above, though this would be inherently unsafe for the exact same reasons.

Let me know if I can explain further or if you have other questions.


author: Przemek Bruski
body: The accepted answer is incorrect. Instant messages are two way. You can talk to Bamboo via IM, there are a couple of commands it accepts.


author: Przemek Bruski
body: While you cannot directly use EMS, you should be able to hook something up to your EMS that would be able to use Bamboo's REST endpoints. This would let you trigger your builds externally. Here's an example:  
`curl -X POST --user admin:admin http:``//host:8085/bamboo/rest/api/latest/queue/PLAN-KEY?os_authType=basic`


author: elucify
body: Tyler adequately answer my question below. Thanks Tyler --mj


Tags: cloud