Is there any way to use a bamboo variable for the branch name when configuring a source repository?
I would like to be able to specify the tag name to fetch in a variable when releasing a version from JIRA.
Yes. We use a variable called git.branch.name and use it as ${bamboo.git.branch.name} in the branch area
You can use variables in the repository configuration, but the caveat is, the repository configuration needs to resolve to sth. that exists.
So if the tag already exists when you trigger the build it should work.
But if you create the tag during the build it won't work, as Bambo will try to find the revision on tag that not exists yet.
There might be a workaround but I haven't tried that:
- define repository with a variable in branch field
- set that variable to 'master' (or whatever that works)
- before checking out, use this Task: https://marketplace.atlassian.com/plugins/com.atlassian.bamboo.plugins.bamboo-variable-inject-plugin to change the value of the variable
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created the tag in the stash repository before doing the release from JIRA. I tried to run the release with the repository branch name set to ${bamboo.jira.version} but it didn't seem to parse the variable, saying it couldn't find the branch '${bamboo.jira.version}'. I tried the same with a custom Plan Variable but got the same result.
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.