|
| 1 | +# Continua CI Setup |
| 2 | + |
| 3 | +This guide explains how to run GitVersion inside [Continua CI](https://www.finalbuilder.com/continua-ci). |
| 4 | + |
| 5 | +## Assumptions |
| 6 | +This guide assumes a few variables are present in the configuration. Note that this example uses `Catel` as repository name, but it should be replaced by the name of the repository where GitVersion is runnign against. |
| 7 | + |
| 8 | +* RepositoryBranchName => $Source.Catel.BranchName$ |
| 9 | +* RepositoryCommitId => $Source.Catel.LatestChangeset.Id$ |
| 10 | +* RepositoryName => Catel |
| 11 | +* RepositoryName => $Source.Catel.Path$ |
| 12 | +* RepositoryUrl => $Source.Catel.Url$ |
| 13 | + |
| 14 | +It also requires a few variables which will automatically be filled by GitVersion. The example below are just a few, any of the GitVersion variables written to the output can be used. |
| 15 | + |
| 16 | +* GitVersion_FullSemVer |
| 17 | +* GitVersion_MajorMinorPatch |
| 18 | +* GitVersion_NuGetVersion |
| 19 | + |
| 20 | +You also need to add a property collector for the agents to detect the GitVersion tool on the agents: |
| 21 | + |
| 22 | +* Namespace => GitVersion |
| 23 | +* Run On => Agent |
| 24 | +* Type => Path Finder Plugin |
| 25 | +* Property Name => Path |
| 26 | +* Executable => GitVersion.exe |
| 27 | +* Search paths => your installation folder (e.g. C:\Tools\GitVersion) |
| 28 | + |
| 29 | +## Basic Usage |
| 30 | +To run GitLink inside [Continua CI](https://www.finalbuilder.com/continua-ci), follow the steps below: |
| 31 | + |
| 32 | +* Add a new `Execute Program` step to a stage |
| 33 | +* In the `Execute Program` tab, set the following values: |
| 34 | + * Executable path: $Agent.GitVersion.Path$ |
| 35 | + * Working directory: %RepositoryPath% |
| 36 | +* In the `Arguments` tab, set the following values: |
| 37 | + * Arguments: /url %RepositoryUrl% /b %RepositoryBranchName% /c %RepositoryCommitId% /output buildserver |
| 38 | +* In the `Options` tab, set the following values: |
| 39 | + * Wait for completion: checked |
| 40 | + * Log output: checked |
| 41 | + * Check program exit code: checked |
| 42 | + * Exit code must be: equal to |
| 43 | + * Exit code: 0 |
| 44 | + |
| 45 | +Now GitVersion will automatically run and fill the `GitVersion_` variables. |
0 commit comments