I have a series of final tasks running in a job because I want them all to execute regardless of pass/fail result. One thing I would like to be able to do is easily differentiate failed results from a command task. What return status from the application is Bamboo expecting to flag the result this way in the log? I've seen it previously for failed results, but have yet to decipher the return status I need to provide to consistently do so.
When using bash script tasks, I always put:
set -o errexit
at the top.
And for "echoing" something to stderr, I have always been using echo "..." 1>&2 for that purpose.
Example: Checking that a variable value was overriden to enforce a custom build run:
#!/bin/sh set -o errexit ARTIFACT_VERSION=$1 if [ ! -z "$ARTIFACT_VERSION" -a "$ARTIFACT_VERSION" != " " ]; then echo "Provided artifact version: $ARTIFACT_VERSION" exit 0 else echo "Artifact version is missing" 1>&2 echo "Run a customized Build and override the build variable 'webforms.blueprint.version'." 1>&2 exit 1 fi exit 0
If a user started a build without setting a custom variable, so he will get:
I hope it will help you.
This is exactly what I ended up doing an reaffirm that redirecting to stderr is the answer. The application I initially asked the question about happened to a be a .NET application, so added System.Console.Error.WriteLine("<text>") for the messaging in the log that I wanted redirected to stderr. Worked perfectly. Thanks for your response.
On 31 May, a GDPR-related change went live in the Bitbucket Cloud API that resulted in users not being able to create or edit Bitbucket Cloud Linked repositories in Bamboo. This API update removed t...
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