Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/build-server-support/build-server/azure-devops
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,35 @@ If you want the GitVersionTask to update AssemblyInfo files, check the box in th

The Azure DevOps Pipeline build step can update your build number with GitVersion variables. See below for details.

#### Using Pipelines yaml

Add the following yaml task and variable to your `azure-pipelines.yml` file:

```yml
variables:
GitVersion.SemVer: ''

steps:
- task: gittools.gitversion.gitversion-task.GitVersion@5
displayName: gitversion
inputs:
useConfigFile: true
configFilePath: GitVersion.yml
```

You can now use the `GitVersion.SemVer` environment variable in any subsequent tasks to refer to the semantic version number for your build. For example, you can build your dotnet core application with a semantic version number like so:

```yml
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: '$(solution)'
configuration: '$(buildConfiguration)'
versioningScheme: byEnvVar
versionEnvVar: 'GitVersion.SemVer'

```

## Running inside TFS
### Using the GitVersion Variables
Expand Down