Is it possible for a bamboo-build to check if a variable exists? I'm having some trouble building a nightly-build-plan which can be run manually, because if it's run manually it passes the ${bamboo.ManualBuildTriggerReason.userName} to my shell-script which executes the nightly build, but if it's run scheduled it exits with an error "bad substitution" because the variable doesn't exist. I'd imagine my problem would be solved if I somehow could check beforehand, if the variable exists and only use it, if it does.
Perhaps a little bit tool late. There is a workaround.
In your bamboo plan, create a variable with the name: ManualBuildTriggerReason.userName
And leave its value empty.
In your script, this variable will be empty in case of a triggered build.
It will not be empty in case of a manual build.
What happens if you do an if-else in your shell script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mind sharing the script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think, that the script has anything to do with what I'm asking, but here it is:
#!/bin/bash user=$1; pw=$2; build_plans=(A-A A-B A-C A-D A-E A-F); for plan in ${build_plans[@]}; do `dirname $0`/bamboo.sh --user $user --password $pw --action queueBuild --build "$plan" --wait done exit 0
Where bamboo.sh holds the server-info.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm also looking for an answer to this question, i've tried all sorts of ways to test if the bamboo variables exist, but if they do not exist bamboo intercepts things before the script is even run which is very annoying.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.