Use the right set of env variables for determining commit hash

This commit is contained in:
Pranav K 2017-07-11 19:20:15 -07:00
parent aa25401a50
commit 98525da02b
1 changed files with 5 additions and 4 deletions

View File

@ -183,11 +183,12 @@
<PropertyGroup>
<!--
Attempt to read environment variables set up by the CI's VCS Root if available.
* vcsroot.<RepositoryName>.url gives us the clone URL for a repository
* build.vcs.number.<RepositoryName> gives us the commit hash for a repository.
* BUILD_VCS_URL_<RepositoryName> gives us the clone URL for a repository
* BUILD_VCS_NUMBER_<RepositoryName> gives us the commit hash for a repository.
-->
<_CloneUrl>$([System.Environment]::GetEnvironmentVariable("vcsroot.%(Repository.Identity).url"))</_CloneUrl>
<_CommitHash>$([System.Environment]::GetEnvironmentVariable("build.vcs.number.%(Repository.Identity)"))</_CommitHash>
<_RepositoryName>$([System.String]::new('%(Repository.Identity)').Replace('.', '_'))</_RepositoryName>
<_CloneUrl>$([System.Environment]::GetEnvironmentVariable("BUILD_VCS_URL_$(_RepositoryName)"))</_CloneUrl>
<_CommitHash>$([System.Environment]::GetEnvironmentVariable("BUILD_VCS_NUMBER_$(_RepositoryName)"))</_CommitHash>
</PropertyGroup>
<Warning Text="%(Repository.Identity) has not been cloned."