Created
January 17, 2019 04:39
-
-
Save mishrsud/f7610a46ee363b47fa6c7fabf341a123 to your computer and use it in GitHub Desktop.
Use gitversion as a docker container on a Linux build agent in Azure Devops (erstwhile VSTS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Docker container: gittools/gitversion-dotnetcore:linux-4.0.1 | |
# NugetPackageVersion is a variable defined for the Azure DevOps pipeline | |
NEXTVERSION="$(docker run --rm -v "$(pwd):$BUILD_SOURCESDIRECTORY/path-to-repo" gittools/gitversion-dotnetcore:linux-4.0.1 $BUILD_SOURCESDIRECTORY/path-to-repo /output json /showvariable MajorMinorPatch)" | |
# the following command sets the pipeline variable's value to NEXTVERSION | |
echo "##vso[task.setvariable variable=NugetPackageVersion]$NEXTVERSION" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment