Date: Fri, 29 Mar 2024 19:43:24 +1100 (AEDT) Message-ID: <530121528.271.1711701804388@SYDWEB02> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_270_1729725098.1711701804386" ------=_Part_270_1729725098.1711701804386 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Note the > operator is always used, you can alternat= ively use >> which will empty the target direct= ory before copying the repository.
[1.1] $Source.M= yRepo$ > 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
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".
Note the > operator is always used, you ca= n alternatively use >> which will empty th= e target directory before copying the repository.
[2.1] $Source.M= yRepo$\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 a= nd puts them in the agent's workspace in the directory So= urce\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 Executable= s..
Note: Since you can specify certain parts of the Reposi= tory, it's possible to put two parts in two different destination locations= . Eg. You could put the $Source.MyRepo$\WebProjects direct= ory in \Source\WebProject and $Source.MyRepo$\WCFP= roject in \MyProject. Because of this, you can't = use the syntax $Source.MyRepo$ in your action to refe= rence the repository directory because it resolves to two different locatio= ns depending on which part of the repository you need. If you want to refer= ence those parts of the repository you will need remember the des= tination directory within the workspace. For example, if you want to access= a file in the WebProjects section of the repository you w= ould use the syntax $Workspace$\Source\MyRepoWebProject an= d to reference something in the WCFProject section of the = repository you would use $Workspace$\Executables.
Note the > operator is always used, you ca= n alternatively use >> which will empty th= e target directory before copying the repository.
[3.1] $Source$ = > Source
[3.1] - The $Source$ descriptor is a special descriptor= that refers to all repositories attached to the Configuration. When specif= ying a destination directory like we have with Source, each repository will be placed in its own directory whic= h is then placed inside the Source directory. The director= y name is determined by the repositories' name when it was created in Conti= nua. For example, if you have two repositories MyRepo1 and= MyRepo2 and you used a rule like 3.1, then your repositor= y 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 re= positories have a common directory and you only want that directory copied = then you will need to specify a rule for each repository.
Note the > operator is always used, you ca= n alternatively use >> which will empty th= e target directory before copying the repository.
[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 fir= st rule instructs Continua to copy all contents of the = MyRepo repository into the MyRepo&n= bsp;directory in the agent's workspace. Howev= er, the exclude rules instructs Continua to ignore and not copy any files i= n MyRepo repository which live in t= he WebProject directory. For this a= nd any other excludes to work, you must specify a destination directory and= it must be the directory in which the include rule has put the files. In t= his particular example, that directory is simply the one specified in the i= nclude rule's destination pattern.
[4.2a] and [4.2b] - The first rule instructs Con=
tinua to copy all contents of all repositories into their respective d=
irectory in the agent's workspace. The following exclude rul=
e [4.2b] tells Continua to not copy files in the MyRepo re=
pository to the destination the include rule was going to put it to. For an=
exclude rule to work correctly when using the $Source$ descriptor, you need to know where the include rule is going to put=
a repositories' contents. Recall example [3.1] and note how the $Source=
$ descriptor automatically creates a repositories' direc=
tory in the destination specified in the rule. In this case, the My=
Repo repository was going to be placed in Source\MyRepo, so when specifying an exclude rule for the MyRepo =
repository, the destination must be Source\MyRepo. =
p>
[4.3a] and [4.3b] - These rules are identical to the rules in =
[4.2], but in this case I've specified to exclude a directory within a repo=
sitory. Note how I didn't specify Source\MyRepo\WebProject=
as the exclude directory. You only need to specify the repositories root d=
irectory when excluding any or all parts of it. Add the colon ":" operator after the zip extension on the left-hand side=
of the repository rule to specify that the archive file should be extracte=
d. Note that only zip archive files are currently supported. The archive file in the repository is automatically extracted after bein=
g exported to the agent workspace. Note that the operators for preserving a=
nd emptying the destination folder are also taken into account when extract=
ing. [5.1] - Extracts all the files in the archive Report.zip in repository ReportRepo to the folder Report/Ex=
tractedFiles. Preserves the directory structure within the zip fil=
e. You can also add a pattern to specify which files to extract from the se=
rver archive file. [6.1] - Extracts all the html files in the root folder =
of the archive Report.zip in repository ReportRepo=
to the folder ReportHtmlFiles. Preserves the dir=
ectory structure within the zip file.5. Extracting archive files exported from the repos=
itory to the agent's workspace.
Rule Exa=
mple Type 5 - Extracting archive rules
5.1 $Source.Rep=
ortRepo$/Report.zip: > Source/MyRepoWebProject/Report/ExtractedFiles
5.2 $Source.ReportRepo$/Report.zip: -> Report/ExtractedFlattened
5.2 $Source.ReportRepo$/Report.zip: >> Report/ExtractedFiles
5.2 $Source.ReportRepo$/Report.zip: ->> Report/ExtractedFlattened
[5.2] - Extracts all the files in the archive Report.zip =
in repository ReportRepo to the folder Report/Extr=
actedFlattened. Flattens the zip directory structure so that all f=
iles are extracted directly to Report/ExtractedFlattened.<=
br>
[5.3] - Extracts all the files in the archive Report.zip =
in repository ReportRepo to the folder Report/Extr=
actedFiles. Empties the destination folder before extracting files=
.
[5.4] - Extracts all the files in the archive Report.zip =
in repository ReportRepo to the folder Report/Extr=
actedFlattened. Empties the destination folder before extracting f=
iles. Flattens the zip directory structure so that all files are extracted =
directly to Report/ExtractedFlattened.
6. Extracting archives using wildcardsRule Example Type 5 - Extracting archive rules with wildcards
6.1 $Source.Rep=
ortRepo$/Report.zip:/*.html > ReportHtmlFiles
6.2 $Source.ReportRepo$/Report.zip:/**.html > Report/HtmlFiles
6.3 $Source.ReportRepo$/Report.zip:/Main/**.xml > MainReport/XmlFiles
6.4 $Source.ReportRepo$/Report.zip:/Report/**/Main/**.html > MainReport/=
HtmlFiles
[6.2] - Extracts all the html files in the archive
[6.3] - Extracts all the xml files under the Main=
folder in the archive Report.zip in repository <=
strong>ReportRepo to the folder MainReport/XmlFiles. Preserves the directory structure under the Main folder within the zip =
file.
[6.4] - Extracts all the html files under the Rep=
ort folder in the archive Report.zip in repositor=
y ReportRepo which are under a sub-folder named Main to th=
e folder MainReport/HtmlFiles. Preserves the directory str=
ucture under the Report folder within the zip file.