TigersEye120
TigersEye120

Reputation: 867

Is there a way to trigger a Jenkins build from Bamboo?

We are currently using Bamboo in our company but need Jenkins for a specific task the Bamboo machine is not capable of. Is it possible to set up a Jenkins build job and trigger it remotely out of Bamboo, so not everybody has to figure out the new interface?

Upvotes: 1

Views: 911

Answers (1)

theraulpareja
theraulpareja

Reputation: 556

You can run Jenkins jobs remotely, even jobs that require parameters, by means of the REST API, find more information in the documentation here.

You can add a Bamboo task in your job to run a shell script that actually consumes the Jenkins API in that case you might need curl to be installed (in case of using a python script you can use requests, etc)

Example: To just run a Jenkins job that does not requires any params:

curl -X POST --user USER:TOKEN JENKINS_URL/job/JOBNAME/build

Example: To run a Jenkins job that requires params:

curl -X POST JENKINS_URL/job/JOB_NAME/build \
  --user USER:TOKEN \
  --data-urlencode json='{"parameter": [{"name":"id", "value":"123"}, {"name":"verbosity", "value":"high"}]}'

Upvotes: 1

Related Questions