diff --git a/eng/build.yml b/eng/build.yml index 07ca10348..82e02fabc 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -40,6 +40,11 @@ phases: - _TeamName: Roslyn-Project-System - _BuildArgs: '' - _SignType: test + - _DOTNETCLIMSRC_READ_SAS_TOKEN: '' + + - ${{ if and(eq(variables['System.TeamProject'], 'internal'), contains(variables['Build.SourceBranch'], 'internal')) }}: + - group: DotNet-MSRC-Storage + - _DOTNETCLIMSRC_READ_SAS_TOKEN: $(dotnetclimsrc-read-sas-token) - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - group: DotNet-Symbol-Server-PATs @@ -79,6 +84,7 @@ phases: env: DOTNET_CLI_UI_LANGUAGE: $(_DOTNET_CLI_UI_LANGUAGE) DropSuffix: $(_DropSuffix) + DOTNETCLIMSRC_READ_SAS_TOKEN: $(_DOTNETCLIMSRC_READ_SAS_TOKEN) - ${{ if ne(parameters.agentOs, 'Windows_NT') }}: - script: 'eng/setbuildinfo.sh $(_BuildArchitecture) $(_BuildConfig)' @@ -98,6 +104,7 @@ phases: displayName: Build env: DropSuffix: $(_DropSuffix) + DOTNETCLIMSRC_READ_SAS_TOKEN: $(_DOTNETCLIMSRC_READ_SAS_TOKEN) - ${{ if or(eq(parameters.agentOs, 'Darwin'), eq(parameters.agentOs, 'FreeBSD')) }}: - script: ./build.sh @@ -108,6 +115,8 @@ phases: $(_BuildArgs) $(_AdditionalBuildParameters) displayName: Build + env: + DOTNETCLIMSRC_READ_SAS_TOKEN: $(_DOTNETCLIMSRC_READ_SAS_TOKEN) - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.agentOs, 'Windows_NT')) }}: - task: NuGetCommand@2 diff --git a/eng/docker/alpine.3.6/Dockerfile b/eng/docker/alpine.3.6/Dockerfile index ac6a7264b..9f9461690 100644 --- a/eng/docker/alpine.3.6/Dockerfile +++ b/eng/docker/alpine.3.6/Dockerfile @@ -18,10 +18,17 @@ RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers RUN chmod -R a+rwx /usr/local RUN chmod -R a+rwx /home -# Set user to the one we just created -USER ${USER_ID} - # Set working directory ARG WORK_DIR WORKDIR ${WORK_DIR} +# Set up Azure Artifacts credential provider +# We download the installer and execute it using ${USER_ID} so that the installer +# put the NuGet plugins in the correct $HOME/.nuget folder. +RUN curl -O https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh +RUN chmod +x ./installcredprovider.sh + +# Set user to the one we just created +USER ${USER_ID} + +RUN ./installcredprovider.sh diff --git a/eng/docker/rhel.6/Dockerfile b/eng/docker/rhel.6/Dockerfile index 1895a1e30..9e2e572d0 100644 --- a/eng/docker/rhel.6/Dockerfile +++ b/eng/docker/rhel.6/Dockerfile @@ -26,7 +26,9 @@ USER ${USER_ID} # Set library path to make CURL and ICU libraries that are in /usr/local/lib visible ENV LD_LIBRARY_PATH /usr/local/lib -# Set working directory +# Set working directory ARG WORK_DIR WORKDIR ${WORK_DIR} +# Set up Azure Artifacts credential provider +RUN wget -qO- https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh | bash diff --git a/eng/docker/rhel/Dockerfile b/eng/docker/rhel/Dockerfile index cd3f4f029..cd5ec2d15 100644 --- a/eng/docker/rhel/Dockerfile +++ b/eng/docker/rhel/Dockerfile @@ -19,6 +19,9 @@ RUN chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo # Set user to the one we just created USER ${USER_ID} -# Set working directory +# Set working directory ARG WORK_DIR WORKDIR ${WORK_DIR} + +# Set up Azure Artifacts credential provider +RUN wget -qO- https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh | bash diff --git a/eng/docker/ubuntu.16.04/Dockerfile b/eng/docker/ubuntu.16.04/Dockerfile index 4713a4b23..c58504613 100644 --- a/eng/docker/ubuntu.16.04/Dockerfile +++ b/eng/docker/ubuntu.16.04/Dockerfile @@ -49,9 +49,17 @@ RUN chmod -R a+rwx /usr/local RUN chmod -R a+rwx /home RUN chmod -R 755 /usr/lib/sudo -# Set user to the one we just created -USER ${USER_ID} - # Set working directory ARG WORK_DIR WORKDIR ${WORK_DIR} + +# Set up Azure Artifacts credential provider. +# We download the installer and execute it using ${USER_ID} so that the installer +# put the NuGet plugins in the correct $HOME/.nuget folder. +RUN curl -O https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh +RUN chmod +x ./installcredprovider.sh + +# Set user to the one we just created +USER ${USER_ID} + +RUN ./installcredprovider.sh diff --git a/eng/dockerrun.sh b/eng/dockerrun.sh index b42852d87..a41b3c059 100755 --- a/eng/dockerrun.sh +++ b/eng/dockerrun.sh @@ -142,7 +142,13 @@ docker run $INTERACTIVE -t --rm --sig-proxy=true \ -e BUILD_SOURCEBRANCH \ -e BUILD_BUILDNUMBER \ -e BUILD_SOURCEVERSION \ + -e SYSTEM_TEAMPROJECT \ + -e DOTNECLIMSRC_READ_SAS_TOKEN \ -e AGENT_JOBNAME \ -e AGENT_OS \ + -e VSS_NUGET_URI_PREFIXES \ + -e VSS_NUGET_ACCESSTOKEN \ + -e DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0 \ + -e NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED=true \ $DOTNET_BUILD_CONTAINER_TAG \ $BUILD_COMMAND "$@" diff --git a/src/redist/targets/GenerateLayout.targets b/src/redist/targets/GenerateLayout.targets index 812329f22..6db1be7be 100644 --- a/src/redist/targets/GenerateLayout.targets +++ b/src/redist/targets/GenerateLayout.targets @@ -18,8 +18,17 @@ $(RedistLayoutPath)sdk\$(SdkVersion)\ + + true + $(DOTNETCLIMSRC_READ_SAS_TOKEN) + + https://dotnetclimsrc.blob.core.windows.net/dotnet/ https://dotnetcli.azureedge.net/dotnet/ + + https://dotnetclimsrc.blob.core.windows.net/dotnet/ https://dotnetcli.blob.core.windows.net/dotnet/ + + https://dotnetclimsrc.blob.core.windows.net/dotnet/ https://dotnetfeed.blob.core.windows.net/dotnet-toolset/ $(HostRid) @@ -277,7 +286,7 @@