Change korebuild branch and fix argument forwarding in bootstrapper

This commit is contained in:
Nate McMaster 2017-03-01 18:14:14 -08:00
parent dcafefd1ab
commit 5ecb48662e
2 changed files with 19 additions and 19 deletions

View File

@ -1,6 +1,6 @@
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries)
{ {
while($true) while($true)
{ {
@ -19,7 +19,7 @@ function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $ret
Start-Sleep -Seconds 10 Start-Sleep -Seconds 10
} }
else else
{ {
$exception = $_.Exception $exception = $_.Exception
throw $exception throw $exception
@ -33,7 +33,7 @@ cd $PSScriptRoot
$repoFolder = $PSScriptRoot $repoFolder = $PSScriptRoot
$env:REPO_FOLDER = $repoFolder $env:REPO_FOLDER = $repoFolder
$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" $koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
if ($env:KOREBUILD_ZIP) if ($env:KOREBUILD_ZIP)
{ {
$koreBuildZip=$env:KOREBUILD_ZIP $koreBuildZip=$env:KOREBUILD_ZIP
@ -43,18 +43,18 @@ $buildFolder = ".build"
$buildFile="$buildFolder\KoreBuild.ps1" $buildFile="$buildFolder\KoreBuild.ps1"
if (!(Test-Path $buildFolder)) { if (!(Test-Path $buildFolder)) {
Write-Host "Downloading KoreBuild from $koreBuildZip" Write-Host "Downloading KoreBuild from $koreBuildZip"
$tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid() $tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid()
New-Item -Path "$tempFolder" -Type directory | Out-Null New-Item -Path "$tempFolder" -Type directory | Out-Null
$localZipFile="$tempFolder\korebuild.zip" $localZipFile="$tempFolder\korebuild.zip"
DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6 DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6
Add-Type -AssemblyName System.IO.Compression.FileSystem Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder)
New-Item -Path "$buildFolder" -Type directory | Out-Null New-Item -Path "$buildFolder" -Type directory | Out-Null
copy-item "$tempFolder\**\build\*" $buildFolder -Recurse copy-item "$tempFolder\**\build\*" $buildFolder -Recurse
@ -64,4 +64,4 @@ if (!(Test-Path $buildFolder)) {
} }
} }
&"$buildFile" $args &"$buildFile" @args

View File

@ -2,7 +2,7 @@
repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $repoFolder cd $repoFolder
koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
if [ ! -z $KOREBUILD_ZIP ]; then if [ ! -z $KOREBUILD_ZIP ]; then
koreBuildZip=$KOREBUILD_ZIP koreBuildZip=$KOREBUILD_ZIP
fi fi
@ -12,12 +12,12 @@ buildFile="$buildFolder/KoreBuild.sh"
if test ! -d $buildFolder; then if test ! -d $buildFolder; then
echo "Downloading KoreBuild from $koreBuildZip" echo "Downloading KoreBuild from $koreBuildZip"
tempFolder="/tmp/KoreBuild-$(uuidgen)" tempFolder="/tmp/KoreBuild-$(uuidgen)"
mkdir $tempFolder mkdir $tempFolder
localZipFile="$tempFolder/korebuild.zip" localZipFile="$tempFolder/korebuild.zip"
retries=6 retries=6
until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null) until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null)
do do
@ -29,18 +29,18 @@ if test ! -d $buildFolder; then
echo "Waiting 10 seconds before retrying. Retries left: $retries" echo "Waiting 10 seconds before retrying. Retries left: $retries"
sleep 10s sleep 10s
done done
unzip -q -d $tempFolder $localZipFile unzip -q -d $tempFolder $localZipFile
mkdir $buildFolder mkdir $buildFolder
cp -r $tempFolder/**/build/** $buildFolder cp -r $tempFolder/**/build/** $buildFolder
chmod +x $buildFile chmod +x $buildFile
# Cleanup # Cleanup
if test -d $tempFolder; then if test -d $tempFolder; then
rm -rf $tempFolder rm -rf $tempFolder
fi fi
fi fi
$buildFile -r $repoFolder "$@" $buildFile -r $repoFolder "$@"