Use different dotnet and artifacts folders when running in docker (on Windows)

This means docker builds won't conflict with each other or with a non-docker build
This commit is contained in:
Daniel Plaisted 2018-12-05 17:48:17 -08:00
parent adea98d49d
commit c6b78f4205
4 changed files with 21 additions and 1 deletions

View file

@ -50,6 +50,10 @@ function InitializeDotNetCli([bool]$install) {
$dotnetRoot = $env:DOTNET_INSTALL_DIR
} else {
$dotnetRoot = Join-Path $RepoRoot ".dotnet"
if ($env:ARCADE_DOTNET_DIR -ne $null)
{
$dotnetRoot = $env:ARCADE_DOTNET_DIR
}
$env:DOTNET_INSTALL_DIR = $dotnetRoot
if (-not (Test-Path(Join-Path $env:DOTNET_INSTALL_DIR "sdk\$dotnetSdkVersion"))) {
@ -342,6 +346,11 @@ function MsBuild() {
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..")
$EngRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
$ArtifactsDir = Join-Path $RepoRoot "artifacts"
if ($env:ARCADE_ARTIFACTS_DIR -ne $null)
{
$ArtifactsDir = [System.IO.Path]::GetFullPath($env:ARCADE_ARTIFACTS_DIR) + "\"
$env:ArtifactsDir = $ArtifactsDir
}
$ToolsetDir = Join-Path $ArtifactsDir "toolset"
$ToolsDir = Join-Path $RepoRoot ".tools"
$LogDir = Join-Path (Join-Path $ArtifactsDir "log") $configuration

View file

@ -15,6 +15,11 @@ useInstalledDotNetCli=${useInstalledDotNetCli:-true}
repo_root="$scriptroot/../.."
eng_root="$scriptroot/.."
artifacts_dir="$repo_root/artifacts"
if [[ -n "${ARCADE_ARTIFACTS_DIR:-}" ]]; then
artifacts_dir="$ARCADE_ARTIFACTS_DIR"
export ArtifactsDir="$artifacts_dir"
fi
toolset_dir="$artifacts_dir/toolset"
log_dir="$artifacts_dir/log/$configuration"
temp_dir="$artifacts_dir/tmp/$configuration"
@ -89,6 +94,10 @@ function InitializeDotNetCli {
dotnet_root="$DOTNET_INSTALL_DIR"
else
dotnet_root="$repo_root/.dotnet"
if [[ -n "${ARCADE_DOTNET_DIR:-}" ]]; then
dotnet_root="$ARCADE_DOTNET_DIR"
fi
export DOTNET_INSTALL_DIR="$dotnet_root"
if [[ ! -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then

View file

@ -55,5 +55,7 @@ docker run $interactiveFlag -t --rm --sig-proxy=true `
-e PB_PACKAGEVERSIONPROPSURL `
-e PB_PUBLISHBLOBFEEDURL `
-e EXTERNALRESTORESOURCES `
-e ARCADE_DOTNET_DIR="/opt/code/artifacts/docker/${dockerImageName}/.dotnet" `
-e ARCADE_ARTIFACTS_DIR="/opt/code/artifacts/docker/${dockerImageName}/" `
$dockerContainerTag `
/opt/code/run-build.sh @additionalArgs

View file

@ -236,7 +236,7 @@
Mode="u+x" />-->
<!-- Build SDK Deb package -->
<DotNetDebTool ToolPath="$(RepoRoot).dotnet"
<DotNetDebTool ToolPath="$(_DotNetRoot)"
InputDirectory="$(LayoutDirectory)"
OutputDirectory="$(DotNetDebToolOutputDirectory)"
PackageName="$(SdkDebianPackageName)"