Hello,
Is it possible to trigger a bamboo plan remotely through the REST API? I want to create a script to run serially run all of our builds. If there is no REST API call, can you create a plan of existing plans?
We're running Bamboo 4.0.1 build 2907.
Thanks
Jeff
Community moderators have prevented the ability to post new answers.
A cURL example
export BAMBOO_USER=foo
export BAMBOO_PASS=bar
export PROJECT_NAME=TST
export PLAN_NAME=DMY
export STAGE_NAME=JOB1
curl --user $BAMBOO_USER:$BAMBOO_PASS -X POST -d "$STAGE_NAME&ExecuteAllStages" http://mybamboohost:8085/rest/api/latest/queue/$PROJECT_NAME-$PLAN_NAME
Did you run into 401 auth errors? I keep on hitting them and I'm not sure how to work around them
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, my new plan didn't allow the user in question rights to build. So, 401 was expected. Silly me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas, Would you know if its possible to execute a single stage within a plan?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was wondering the same thing Haani. You would think if you have to specify "Stage&ExecuteAllStages", you would be able to specify just "Stage". I've tested this on Bamboo 5.7.1 with no success. All in all, I guess it makes sense that you can't run a single Stage, since Stages are meant to me sequential and executed only after the previous Stage is successful. In which case, the only option for isolating a specific Stage would be to create a separate build plan. Not ideal, but that's where I've landed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"HTTP Status 405 - The specified HTTP method is not allowed for the requested resource." .. I am getting this error ..please help me out
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"my new plan didn't allow the user in question rights to build. So, 401 was expected." Actually, a 403 would be more adequate I think.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jeff,
I think you want the API call :
defined on this page : http://docs.atlassian.com/bamboo/REST/4.0/
which states :
Fire build execution for specified plan. Effectively, this method adds build to the build queue, so is not guarantied that build would be executed immediately. Depending on currently executed builds and length of build queue, build may be executed when queue would be drained. Additional variables could be passed to this method either as form encoded POST payload or query parameters. PLEASE note: Query parameters are more important - override those stored in form payload. Variables defined in Bamboo as global variables or plan variables MUST be prefixed with bamboo.variable ie. bamboo.variable.myVariable=valueForMyVariable. When global or plan variables would be passed to this method, will override default values for variables.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can anyone give the syntax of this REST call in Python?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
url=http://mybamboohost:8085/rest/api/latest/queue/$PROJECT_NAME-$PLAN_NAME
headers={'Authorization':'Basic %s'% userpass}
response = requests.get(url,headers=headers)
you can get result via response.content.
response.content will give a html page if any error or nothing when suceess.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank you for the post.
Can anyone please help us to understand how we can call PUT request by passing variable values in Python.
This is required to Build Plan (Customised) with parameter from our application server.
Thanks a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using wget:
wget --save-cookies cookies.txt --post-data "os_username=XXX&os_password=XXX&os_cookie=true" "http://URL/bamboo/userlogin/!default.action" wget --load-cookies cookies.txt --header="Content-Type: application/xml" --header="X-Atlassian-Token: no-check" --post-data="PLAN&ExecuteAllStages" http://URL/rest/api/latest/queue/PLAN1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is Bamboo plugin to enable you to do it as a part of any plan. It adds tasks to run plan, create deployment/rollback etc.
https://marketplace.atlassian.com/apps/1215720/plan-runners-for-bamboo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All
I am facing an issue while trigger the bamboo5 build using REST API java client. I am getting the 405 error
Let say PROJECT KEY = ABC
PLAN_KEY=XYZ
Can anyone send me the piece of java code to trigger the bamboo build using java client
Note: I have written the java code to access JIRA updating status etc using REST API from java client i tried similar code to access but it's not going through. Also i haven't see any clear documentation how to trigger bamboo5 using java calling rest api
Please provide me some kind of example. It will help
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another option is to use queueBuild from the Bamboo Command Line Interface . It has an option to wait for the build to complete so that you can serialize actions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.