|
1 | 1 | # Visual Studio Online (Build vNext) Setup
|
2 | 2 | ## Basic Usage
|
3 |
| -In [Visual Studio Online](https://www.visualstudio.com/) build vNext (the web based build system) you can add a build step as follows: |
| 3 | +In [Visual Studio Online](https://www.visualstudio.com/) build vNext (the web based build system) you can add GitVersion as a Build Step. This requires a one-time setup to import the GitVersion task into your VSO instance. |
4 | 4 |
|
5 |
| -* **Build Step:** Command Line |
6 |
| - * Might need to fully qualify the path. |
7 |
| - * Tip: Use a script and/or another command step to call `NuGet Install GitVersion.CommandLine` first so you don't have to check in the exe. |
8 |
| -* **Tool:** `GitVersion.exe` |
9 |
| -* **Arguments:** `/output buildserver /updateassemblyinfo true` |
| 5 | +## Installing/updating the VSO Build Step |
| 6 | +1. Install the `tfx` command line tool as shown [here](https://github.com/Microsoft/tfs-cli/blob/master/docs/buildtasks.md) |
10 | 7 |
|
11 |
| -Then in your build parameters simply [add a placeholder](#nuget-in-teamcity) of the GitVersion variables you would like to use. |
| 8 | +2. Download the GitVersion VSO extension from here **TODO determine link** and unzip. |
| 9 | +3. Run `tfx login` if you haven't yet, make sure to use `https://<server>.visualstudio.com/DefaultCollection` as the URL and provide a Personal Access Token |
| 10 | +4. From the directory outside of where you unzipped the task, run `tfx upload .\GitVersionVsoStep` where GitVersionVsoStep is the directory containing the files. |
| 11 | +5. It should successfully install |
12 | 12 |
|
13 |
| -GitVersion writes build parameters into VSO, so they will automatically be passed to your build scripts to use. |
| 13 | +## Using the GitVersion VSO Build Step |
| 14 | +From a VSO vNext Build Definition, select "Add a Step" and then in the Build category, choose GitVersion and Click Add. You'll probably want to drag the task to be at or near the top to ensure it executes before your other build steps. |
| 15 | + |
| 16 | +If you want the GitVersionTask to update AssemblyInfo files, check the box in the task configuration. For advanced usage, you can pass additional options to the GitVersion exe in the Additional arguments section. |
| 17 | + |
| 18 | +## Using the GitVersion Variables |
| 19 | +GitVersion writes build parameters into VSO, so they will automatically be passed to your build scripts to use. It also writes GITVERSION_* environment variables that are available for any subsequent build step. |
14 | 20 |
|
15 |
| -## GitVersion Build Step for VSO |
16 |
| -Visual Studio Online has support for custom build steps. This is planned but TBD. For now, the command line does work. |
17 | 21 |
|
18 | 22 |
|
19 |
| -## Running inside TeamCity |
| 23 | +## Running inside Visual Studio Online |
20 | 24 | * We output the individual values of the GitVersion version as the build parameter: `GitVersion.*` (Eg: `GitVersion.Major`) if you need access to them in your build script
|
21 | 25 |
|
22 | 26 | ### NuGet in VSO
|
|
0 commit comments