# Variables for global/project/config repositories

**URL:** https://www.finalbuilder.com/forums/t/variables-for-global-project-config-repositories/5078
**Category:** Discussion
**Created:** [October 9, 2013, 5:22am UTC](https://www.finalbuilder.com/forums/t/variables-for-global-project-config-repositories/5078 "2013-10-09T05:22:13Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![gastelllo](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@gastelllo](https://www.finalbuilder.com/forums/u/gastelllo)
#### Post date: [October 9, 2013, 5:22am UTC](https://www.finalbuilder.com/forums/t/variables-for-global-project-config-repositories/5078/1 "2013-10-09T05:22:13Z")

</div>

I setup a global repo and noticed that it was stored at the following location:

M:\CI\_WS\Repos\3a296204

Is there a variable in CCI that will reference this path? &nbsp;My build routine requires the build directory to have a copy of the repository. &nbsp;Right now I'm doing a "double pull" to get around this, but it would be nice if I could just pull it from the repo CCI uses.

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [October 10, 2013, 12:27pm UTC](https://www.finalbuilder.com/forums/t/variables-for-global-project-config-repositories/5078/2 "2013-10-10T12:27:45Z")

</div>

Yes, you can refer repository files using&nbsp;$Source

e.g.&nbsp;$Source.RepoName$\Subfolder

The repository is cloned to the&nbsp;M:\CI\_WS\Repos\3a296204&nbsp;on the agent. The Repository Rules are then used to copy to the workspace folder on the agent e.g.&nbsp;M:\CI\_WS\Ws\3a296204. By default they are copied to&nbsp;M:\CI\_WS\Ws\3a296204\Source&nbsp;which can be accessed via&nbsp;$Workspace$\Source.

```
Read more about Repository Rules and Workspace Rules in the wiki under&nbsp;[Stage Options](http://wiki.finalbuilder.com/x/_QAZ)
```

---

<div class="post-metadata">

### Author: ![gastelllo](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@gastelllo](https://www.finalbuilder.com/forums/u/gastelllo)
#### Post date: [October 10, 2013, 3:46am UTC](https://www.finalbuilder.com/forums/t/variables-for-global-project-config-repositories/5078/3 "2013-10-10T03:46:53Z")

</div>

Dave,   
  
 Thanks.   
  
 My build routine requires that the working directory to have a copy of the repository, as my build script uses issues hg commands to get the changeset of the version being built. I’ve no desire to change this procedure.   
  
 When CCI does it’s stuff, the repo is cloned to the agent at: M:\CI\_WS\Repos\4aea1efe   
 Then the Repository Rules creates the workspace on the agent at: M:\CI\_WS\Ws\10\Source   
  
 However M:\CI\_WS\Ws\10\Source is a copy, not a clone, and therefore doesn’t have the .hg folder so I can’t build from there. Is there way to clone this with the Repo rules instead of copy?   
  
  
 As a workaround, I’ve created a M:\build directory, and I have my buildrunner pull/update from the online repo. If I can’t fix the above issue (workspace being a repo) then I’d like to have my buildrunner (FB7) pull/update from M:\CI\_WS\Repos\4aea1efe using a variable.   
  
  
 $Source.RepoName$ evalutes to M:\CI\_WS\WS\10, which appears to be the workspace files and not the repo path.

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [October 11, 2013, 1:02am UTC](https://www.finalbuilder.com/forums/t/variables-for-global-project-config-repositories/5078/4 "2013-10-11T01:02:56Z")

</div>

Hi Igor,

One of the advantages on Continua CI is that it manages the repository automatically and updates the workspace with the latest changeset on the branch when running a build. You should not need to run any hg commands in your Finalbuilder script and we do not want to encourage accessing the Repository cache as this is key to the internal workings of Continua.   
  
Can you provide more details of what hg commands your script needs to run?

If you just need information about the changeset being built, the following variables are available in input boxes which support expressions:

$Source.RepoName.Branch$  
$Source.RepoName.BranchName$  
$Source.RepoName.LatestChangesetID$  
$Source.RepoName.Path$  
$Source.RepoName.Type$  
$Source.RepoName.Url$

---

<div class="post-metadata">

### Author: ![gastelllo](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@gastelllo](https://www.finalbuilder.com/forums/u/gastelllo)
#### Post date: [October 11, 2013, 7:14am UTC](https://www.finalbuilder.com/forums/t/variables-for-global-project-config-repositories/5078/5 "2013-10-11T07:14:22Z")

</div>

One step forward, two steps back.   
  
 If I want to do a manual build, how can I tell CCI that I want to use a specific changeset hashcode? CCI always updates to the latest named branch. Sometimes I need to build prior versions.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [October 12, 2013, 1:35am UTC](https://www.finalbuilder.com/forums/t/variables-for-global-project-config-repositories/5078/6 "2013-10-12T01:35:54Z")

</div>

At this time, you cannot. It’s on the todo list, but I can’t say when it would be done.

---

<div class="post-metadata">

### Author: ![gastelllo](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@gastelllo](https://www.finalbuilder.com/forums/u/gastelllo)
#### Post date: [October 12, 2013, 3:24am UTC](https://www.finalbuilder.com/forums/t/variables-for-global-project-config-repositories/5078/7 "2013-10-12T03:24:55Z")

</div>

As a workaround I’m cloning the ContinuaCI repo to a working directory with FBS then updating that with the proper changeset. Seems to work.
