Merge pull request #3809 from livarcocc/align_run_build
Aligning the two versions of run-build
This commit is contained in:
commit
36c9a04153
3 changed files with 30 additions and 26 deletions
|
@ -8,33 +8,8 @@ param(
|
||||||
|
|
||||||
$RepoRoot = "$PSScriptRoot"
|
$RepoRoot = "$PSScriptRoot"
|
||||||
|
|
||||||
# Load Branch Info
|
|
||||||
cat "$RepoRoot\branchinfo.txt" | ForEach-Object {
|
|
||||||
if(!$_.StartsWith("#") -and ![String]::IsNullOrWhiteSpace($_)) {
|
|
||||||
$splat = $_.Split([char[]]@("="), 2)
|
|
||||||
Set-Content "env:\$($splat[0])" -Value $splat[1]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot
|
|
||||||
if (!$env:DOTNET_INSTALL_DIR)
|
|
||||||
{
|
|
||||||
$env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\$Architecture"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(Test-Path $env:DOTNET_INSTALL_DIR))
|
|
||||||
{
|
|
||||||
mkdir $env:DOTNET_INSTALL_DIR | Out-Null
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install a stage 0
|
# Install a stage 0
|
||||||
Write-Host "Installing .NET Core CLI Stage 0 from branchinfo channel"
|
Write-Host "Installing .NET Core CLI Stage 0 from branchinfo channel"
|
||||||
|
|
||||||
& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Channel $env:CHANNEL -Architecture $Architecture -Verbose
|
& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Channel $env:CHANNEL -Architecture $Architecture -Verbose
|
||||||
if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
|
if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
|
||||||
|
|
||||||
# Put the stage0 on the path
|
|
||||||
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
|
|
||||||
|
|
||||||
# Disable first run since we want to control all package sources
|
|
||||||
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
|
|
@ -34,8 +34,33 @@ else
|
||||||
$env:DOTNET_BUILD_SKIP_PACKAGING=0
|
$env:DOTNET_BUILD_SKIP_PACKAGING=0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Load Branch Info
|
||||||
|
cat "$RepoRoot\branchinfo.txt" | ForEach-Object {
|
||||||
|
if(!$_.StartsWith("#") -and ![String]::IsNullOrWhiteSpace($_)) {
|
||||||
|
$splat = $_.Split([char[]]@("="), 2)
|
||||||
|
Set-Content "env:\$($splat[0])" -Value $splat[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot
|
||||||
|
if (!$env:DOTNET_INSTALL_DIR)
|
||||||
|
{
|
||||||
|
$env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\$Architecture"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(Test-Path $env:DOTNET_INSTALL_DIR))
|
||||||
|
{
|
||||||
|
mkdir $env:DOTNET_INSTALL_DIR | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
& "$RepoRoot\init-tools.ps1" -Architecture $Architecture
|
& "$RepoRoot\init-tools.ps1" -Architecture $Architecture
|
||||||
if($LASTEXITCODE -ne 0) { throw "Failed to install Init Tools" }
|
if($LASTEXITCODE -ne 0) { throw "Failed to install Init Tools" }
|
||||||
|
|
||||||
|
# Put the stage0 on the path
|
||||||
|
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
|
||||||
|
|
||||||
|
# Disable first run since we want to control all package sources
|
||||||
|
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||||
|
|
||||||
dotnet build3 build.proj /p:Architecture=$Architecture
|
dotnet build3 build.proj /p:Architecture=$Architecture
|
||||||
if($LASTEXITCODE -ne 0) { throw "Failed to build" }
|
if($LASTEXITCODE -ne 0) { throw "Failed to build" }
|
||||||
|
|
|
@ -36,6 +36,10 @@ while [[ $# > 0 ]]; do
|
||||||
# Allow CI to disable prereqs check since the CI has the pre-reqs but not ldconfig it seems
|
# Allow CI to disable prereqs check since the CI has the pre-reqs but not ldconfig it seems
|
||||||
export DOTNET_INSTALL_SKIP_PREREQS=1
|
export DOTNET_INSTALL_SKIP_PREREQS=1
|
||||||
;;
|
;;
|
||||||
|
--architecture)
|
||||||
|
ARCHITECTURE=$2
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--help)
|
--help)
|
||||||
echo "Usage: $0 [--configuration <CONFIGURATION>] [--targets <TARGETS...>] [--skip-prereqs] [--nopackage] [--docker <IMAGENAME>] [--help]"
|
echo "Usage: $0 [--configuration <CONFIGURATION>] [--targets <TARGETS...>] [--skip-prereqs] [--nopackage] [--docker <IMAGENAME>] [--help]"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue