How to get build status in a Bamboo build task script?

I am adding a Script Task in Bamboo, which I want to evaluate the result of the build so I can conditional do something.

I can see that it knows, how can I find out?

simple    15-May-2015 15:27:42    Failing task since return code of [/usr/local/rvm/rubies/ruby-2.2.0/bin/ruby /usr/local/rvm/gems/ruby-2.2.0@quiqup_api/bin/bundle exec rspec spec --format RspecJunitFormatter --out rspec.xml] was 1 while expected 0
simple    15-May-2015 15:27:42    Finished task 'rspec' with result: Failed
simple    15-May-2015 15:27:42    Starting task 'Parse results' of type 'com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.junit'
simple    15-May-2015 15:27:42    Parsing test results under /opt/bamboo-home/xml-data/build-dir/4784130/API-RSPEC11-JOB1...
simple    15-May-2015 15:27:42    Failing task since 1 failing test cases were found.
simple    15-May-2015 15:27:42    Finished task 'Parse results' with result: Failed

 

2 answers

0 vote

I'm afraid we don't have anything like that atm, but it would make a lot of sense if you try to use cleanup script in your "final task" section of the build.

I've opened this improvement request:

https://jira.atlassian.com/browse/BAM-15979

What is  currently possible  is to create your own version of the Script Task, as build status is accessible from Task object, just not exposed to the environment.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,319 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you