ctaggart / SourceLink

Source Code On Demand
MIT License
356 stars 55 forks source link

Standardized Environment Variables for TeamCity #359

Closed ctaggart closed 6 years ago

ctaggart commented 6 years ago

Similar to AppVeyor #355 and following https://github.com/dotnet/designs/blob/master/accepted/build/standard-ci-env-variables.md

STANDARD_CI_REPOSITORY_URL = vcsroot.url STANDARD_CI_SOURCE_REVISION_ID = build.vcs.number

image

image

image

Let's see if this works.

ctaggart commented 6 years ago

I forgot the %s above. It needs to be: image

Since I'm building from the docker image, I pass in the environment variables:

docker run --rm -v $PWD:/app-w /app \
-e STANDARD_CI_REPOSITORY_TYPE="git" \
-e STANDARD_CI_REPOSITORY_URL="$STANDARD_CI_REPOSITORY_URL" \
-e STANDARD_CI_SOURCE_REVISION_ID="$STANDARD_CI_SOURCE_REVISION_ID" \
microsoft/dotnet:2.1-sdk \
./build.sh

Still having issues, so will file a issue in the other repo.

ctaggart commented 6 years ago

The main benefit for these environment variables is triggering a /p:ContinousIntegrationBuild=true in order to have deterministic builds. It looks like that is going to require a require a separate Microsoft.Build.StandardCI nuget package. It may be easier to set the property directly or conditionally in Directory.Build.props`.