I have 2 repositories in 1 plan where repo1 is the default repo and repo2 is non default. The way Bamboo plans work is the default repo is able to checkout to specific branches, but the non-default can only checkout to master. I am trying find a way around this so that I can pass in a plan variable to repo2 that sets it to what branch I want.This is what I've experimented with so far:
1. Added a plan variable
I override this on a manual build
2. Passed in the plan variable into the script
$bamboo_planRepository_2_branch
this tells you branch info when you echo it out.
So I tried doing this but didn't work:
What is the correct way to override build-specific variables in Bamboo?
What you seem to be after is this feature: https://jira.atlassian.com/browse/BAM-11544 which has been delivered in Bamboo 6.3.0
Variable is only used for Subversion repository when Bamboo perform Source Code Checkout task. It is not being used in other repository types.
Your requirement for Source Code Checkout task to checkout specific branch for other non default repositories has been implemented in Bamboo 6.3.0:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure what you are trying to do but you can get the branch name from the system variable named:
bamboo.planRepository.<position>.branchName
where position is an optional parameter that specifies the position of the repository in the plan's repository list. If omitted, the first repository in the list is used.
If you are trying to set a variable, why do you want to override a bamboo variable? Why not define a new one?
plan_branch=${bamboo.repo2_branch}
and then use ${plan_branch} in the next steps?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah corect this is a system variable:
bamboo.planRepository.<position>.branchName
And that translates in the task script as:
$bamboo_planRepository_2_branch
And I want to override a different branch to that system variable like my example in the description.
Reason for this is it is a non-default repo, so only master is checked out all the time
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Those variables are _derived_ from your build configuration, they are not meant to be reset and changing their value won't have any effect other than, well, their value is now changed.
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.