You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

1. Copy entire repository into the agent's workspace

Note the > operator is always used, you can alternatively use >> which will empty the target directory before copying the repository.

Rule Example Type 1 - Single Repository

 

[1.1] $Source.MyRepo$ > Source\MyRepo
[1.2] $Source.ToolsRepo$ > Binaries

 

[1.1] - Takes the contents of the Repository MyRepo and puts it in the agent's workspace in the directory Source\MyRepo.

[1.2] - You don't need to place a repositories' contents in the \Source directory, it's more of a convention. This rule will take the contents of the Repository ToolsRepo and put it in \Binaries in the agent's workspace.

Note: By specifying to copy the entire repository like examples 1.1 and 1.2, you can take advantage of the Source descriptor when supplying values to actions. In other words, if you create a action, for example MSBuild and want to use the build file "project.sln" found in the MyRepo repository, you could use the syntax "$Source.MyRepo$\project.sln". The alternate way of getting a path to the file would be "$Workspace$\Source\MyRepo\project.sln".

 

2. Copy parts of a repository into the agent's workspace

Note the > operator is always used, you can alternatively use >> which will empty the target directory before copying the repository.

Rule Example Type 2 - Parts of a repository

 

[2.1] $Source.MyRepo$\WebProject\** > Source\MyRepoWebProject
[2.2] $Source.ToolsRepo$\**exe > Executables

 

[2.1] - Searches the contents of Repository MyRepo and gets all files out of the WebProject directory and puts them in the agent's workspace in the directory Source\MyRepoWebProject.

[2.2] - Searches the contents of Repository ToolsRepo and gets all files that have the extension ".exe" and puts them in the agent's workspace in the directory Executables..

Note: Since you can specify certain parts of the Repository, it's possible to put two parts in two different destination locations. Eg. You could put the $Source.MyRepo$\WebProjects directory in \Source\WebProject and $Source.MyRepo$\WCFProject in \MyProject. Because of this, you can't use the syntax $Source.MyRepo$ in your action to reference the repository directory because it resolves to two different locations depending on which part of the repository you need. If you want to reference those parts of the repository you will need remember the destination directory within the workspace. For example, if you want to access a file in the WebProjects section of the repository you would use the syntax $Workspace$\Source\MyRepoWebProject and to reference something in the WCFProject section of the repository you would use $Workspace$\Executables.

 

3. Copy all repositories

Note the > operator is always used, you can alternatively use >> which will empty the target directory before copying the repository.

Rule Example Type 3 - All repositories

 

[3.1] $Source$ > Source

 

[3.1] - The $Source$ descriptor is a special descriptor that refers to all repositories attached to the Configuration. When specifying a destination directory like we have with Source, each repository will be placed in its own directory which is then placed inside the Source directory. The directory name is determined by the repositories' name when it was created in Continua. For example, if you have two repositories MyRepo1 and MyRepo2 and you used a rule like 3.1, then your repository contents would be placed in \Source\MyRepo1 and \Source\MyRepo2. 

Note: Any paths or patterns specified after the $Source$ descriptor is ignored, so if for some reason all your repositories have a common directory and you only want that directory copied then you will need to specify a rule for each repository.

 

4. Repository exclude rules

Note the > operator is always used, you can alternatively use >> which will empty the target directory before copying the repository.

Rule Example Type 4 - Excluding repositories and parts of repositories

 

[4.1a] $Source.MyRepo$ > MyRepo
[4.1b] - $Source.MyRepo$\WebProject\** > MyRepo
 
[4.2a] $Source$ > Source
[4.2b] - $Source.MyRepo$ > Source\MyRepo
 
[4.3a] $Source$ > Source
[4.3b] - $Source.MyRepo$\WebProject\** > Source\MyRepo

[4.1a] and [4.1b] - These two rules execute together. The first rule instructs Continua to copy all contents of the MyRepo repository into the MyRepo directory in the agent's workspace. However, the exclude rules instructs Continua to ignore and not copy any files in MyRepo repository which live in the WebProject directory. For this and any other excludes to work, you must specify a destination directory and it must be the same directory as you specified in your include pattern otherwise the exclude rule won't be checked when your include rule is.

[4.2a] and [4.2b] - The first rule instructs Continua to copy all contents of all repositories into their respective directory in the agent's workspace. Recall example [3.1]

 

 

 

 

 

 

 

 

  • No labels