I would like to write a bash script to use the Bamboo REST API in order to trigger a plan tests and would like to wait for it to finish and get a result (failed or success).
Upon success, I would like to do something in the pipeline.
I found the following commands:
#This triggers the plan
curl -k --user user:password -X POST -d "stage&executeAllStages" https://bamboo.myserver.com/rest/api/latest/queue/XXX-YYY
I can parse the result of that command in order to get the build number by:
I can use the extracted build number in order to query the result:
curl -k --user user:password -X GET https://bamboo.myserver.com/rest/api/latest/result/XXX-YYY/build-number
And then i need to parse result and do a busy wait to ask again and parse until there is an answer.
I am sure this is bad practice and would like to ask if there is one command (REST API) that do that for me. Just not returning until there is an answer.
Many thanks in advanced
I don't see a better option to get the information you want other than using REST API and asynchronously checking if the build finished.
I have a suggestion for small improvements in your approach.
I guess those are pieces of advice can give you.
G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events