Avoid modifying global machine state on Helix (#20315)

This commit is contained in:
Brennan 2020-03-30 15:34:02 -07:00 committed by GitHub
parent c7e03508ce
commit cc2f5497e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 4 deletions

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
</configuration>

View File

@ -23,14 +23,20 @@ echo "Installing SDK"
powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture %$arch% -Version %$sdkVersion% -InstallDir %DOTNET_ROOT%"
echo "Installing Runtime"
powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture %$arch% -Runtime dotnet -Version %$runtimeVersion% -InstallDir %DOTNET_ROOT%"
REM "Rename default.NuGet.config to NuGet.config if there is not a custom one from the project"
if not EXIST ".\NuGet.config" (
copy default.NuGet.config NuGet.config
)
echo "Checking for Microsoft.AspNetCore.App"
if EXIST ".\Microsoft.AspNetCore.App" (
echo "Found Microsoft.AspNetCore.App, copying to %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%"
xcopy /i /y ".\Microsoft.AspNetCore.App" %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%\
echo "Adding current directory to nuget sources: %HELIX_WORKITEM_ROOT%"
dotnet nuget add source %HELIX_WORKITEM_ROOT%
dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json
dotnet nuget add source %HELIX_WORKITEM_ROOT% --configfile NuGet.config
dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --configfile NuGet.config
dotnet nuget list source
dotnet tool install dotnet-ef --global --version %$efVersion%

View File

@ -93,6 +93,12 @@ if [ $? -ne 0 ]; then
done
fi
# Rename default.NuGet.config to NuGet.config if there is not a custom one from the project
if [ ! -f "NuGet.config" ]
then
cp default.NuGet.config NuGet.config
fi
# Copy over any local shared fx if found
if [ -d "Microsoft.AspNetCore.App" ]
then
@ -100,8 +106,8 @@ then
cp -r Microsoft.AspNetCore.App $DOTNET_ROOT/shared/Microsoft.AspNetCore.App/$dotnet_runtime_version
echo "Adding current directory to nuget sources: $DIR"
dotnet nuget add source $DIR
dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json
dotnet nuget add source $DIR --configfile NuGet.config
dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --configfile NuGet.config
dotnet nuget list source
dotnet tool install dotnet-ef --global --version $efVersion