Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Using a bamboo variable in git repository branch configuration

tc-mossridge September 11, 2013

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.

2 answers

0 votes
roy_lyons
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 13, 2013

Yes. We use a variable called git.branch.name and use it as ${bamboo.git.branch.name} in the branch area

0 votes
Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 12, 2013

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

tc-mossridge September 17, 2013

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events