Hi,
I order to be able to release from JIRA and directly from Bambooo, we've been using the following shell inline script to run in some of our plans:
...
if [ -n "${bamboo.version.name}" ]; then
VERSION_NAME="${bamboo.version.name}"
else
VERSION_NAME="${bamboo.jira.version}"
fi
...
All good up to here.
Today we've added the bit below, and our builds keep failing with bad substitution error message:
...
if [ -n "${bamboo.jira.username}" ]; then
BUILD_USER="${bamboo.jira.username}"
else
BUILD_USER="${bamboo.ManualBuildTriggerReason.userName}"
fi
...
Also tried the more obscure oneliner:
BUILD_USER="${bamboo.jira.username:-$(echo ${bamboo.ManualBuildTriggerReason.userName})}"
If I run the same code as a shell script (getting rid of the dots in the variable names) seems to work fine.
If I run a task with a plain script displaying the environment variables with env, I see those variables are not exported.
Any ideas on how to use BUILD_USER in my build scripts?