Variable expressions and repository instances


In the Continua CI help under ‘Variable Types - Expressions’ it gives the example of '$Server.Now$. I was wondering
however if its actually possible to create a variable for '$Source.RepoName$ (lets call it ‘Repository’) and then reference the variable
like %Repository.Branch%? From my experimentation the answer seems no but I thought i would get your official word on this.

The reason why I would want to-do this is that we currently use a configuration per branch and duplicate the configuration when we create a new
branch. But each configuration requires its own repostiory, each with a unique name. So even after duplicating the configuration there are some
fifty or so references to ‘$Source.ThisRepoName$’ that must be manually updated to ‘$Source.ThatRepoName$’.

I would love to be able to create a variable expression that I only have to update that once per configuration to resolve the issue.

Hi Simon,

It’s not possible to create a variable based on an expression. You could use a Set Variable action to set a variable to an expression at the start of the first stage and use that variable in subsequent stages and actions. This would not however apply to the repository rules for the first stage. 

We’re wondering why you need to create a repository per branch? You could alternatively set up one repository which monitors branches by pattern and use branch mappings to specify the default branch for each configuration. 

Hi Dave,

I’m trying to use branch mappings but I’m getting no where fast. I tend to use the things that have worked in the past because, as a full time programmer, I don’t technically have any time allocated todo any of this stuff.


Also at some point in time I’m eventually going to have to duplicate a configuration so I can customise it as has been required in the past.


I’ve also run into some weird bugs like where Continua CI claims a repository is shared by multiple configurations when its set as a configuration level repository and is not listed on any other configuration repository page. It also prevents me from re-naming a configuration because its says it already exists when I cannot see it listed anywhere.


Hi Dave,

I can only assume I’m doing something wrong because I’ve created a branch based repository but it seems to take hours to initialise (it took over 2 hours to reset).
Maybe the hardware I’m using is not sufficient to use this feature? Its running on a VM with vary limited resources.

Simon. K

Hi Simon,

Thank you for sending the email with further details and log. I’ve sent my responses in reply to the email