From 57ce370b511677253b9a4893dc56f65eea7d6e10 Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Tue, 16 Feb 2016 12:04:13 -0800 Subject: [PATCH] remove ci_build.cmd --- build.sh | 27 +++++++++++++++++++++++++++ netci.groovy | 10 +++++++--- scripts/ci_build.cmd | 30 ------------------------------ scripts/run-build.ps1 | 13 ++++++++++++- 4 files changed, 46 insertions(+), 34 deletions(-) delete mode 100644 scripts/ci_build.cmd diff --git a/build.sh b/build.sh index fb885b57b..93feb4060 100755 --- a/build.sh +++ b/build.sh @@ -16,6 +16,33 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +while [[ $# > 0 ]]; do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + -c|--configuration) + export CONFIGURATION=$2 + shift + ;; + --nopackage) + export DOTNET_BUILD_SKIP_PACKAGING=1 + ;; + --docker) + export BUILD_IN_DOCKER=1 + export DOCKER_IMAGENAME=$2 + shift + ;; + "--buildindocker-centos") + export BUILD_IN_DOCKER=1 + export DOCKER_IMAGENAME=centos + ;; + *) + break + ;; + esac + + shift +done + # Check if we need to build in docker if [ ! -z "$BUILD_IN_DOCKER" ]; then $DIR/scripts/dockerbuild.sh "$@" diff --git a/netci.groovy b/netci.groovy index 49d474f8a..47a288729 100644 --- a/netci.groovy +++ b/netci.groovy @@ -26,10 +26,14 @@ def static getBuildJobName(def configuration, def os) { // Calculate the build command if (os == 'Windows_NT') { - buildCommand = ".\\scripts\\ci_build.cmd ${lowerConfiguration}" + buildCommand = ".\\build.cmd -Configuration ${lowerConfiguration} Default" + } + else if (os == 'Ubuntu') { + buildCommand = "./build.sh --configuration ${lowerConfiguration} --docker ubuntu Default" } else { - buildCommand = "./scripts/ci_build.sh ${lowerConfiguration}" + // Jenkins non-Ubuntu CI machines don't have docker + buildCommand = "./build.sh --configuration ${lowerConfiguration} Default" } def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) { @@ -57,4 +61,4 @@ def static getBuildJobName(def configuration, def os) { } } } -} \ No newline at end of file +} diff --git a/scripts/ci_build.cmd b/scripts/ci_build.cmd deleted file mode 100644 index 752f1430b..000000000 --- a/scripts/ci_build.cmd +++ /dev/null @@ -1,30 +0,0 @@ -@echo off - -REM Copyright (c) .NET Foundation and contributors. All rights reserved. -REM Licensed under the MIT license. See LICENSE file in the project root for full license information. - -set CI_BUILD=1 -set VERBOSE=1 - -REM Shift breaks %~dp0 so capture it first -set MY_DIR=%~dp0 - -REM Parse arguments -:loop -IF NOT "%1"=="" ( - IF "%1"=="-NoPackage" ( - SET DOTNET_BUILD_SKIP_PACKAGING=1 - ) ELSE IF "%CONFIGURATION%"=="" ( - SET CONFIGURATION=%1 - ) ELSE IF "%TARGETS%"=="" ( - SET TARGETS=%1 - ) ELSE ( - SET TARGETS=%TARGETS% %1 - ) - SHIFT - GOTO :loop -) - -CALL %MY_DIR%..\build.cmd %TARGETS% - -exit /b %errorlevel% diff --git a/scripts/run-build.ps1 b/scripts/run-build.ps1 index 9b9453722..a72a30e38 100644 --- a/scripts/run-build.ps1 +++ b/scripts/run-build.ps1 @@ -4,10 +4,20 @@ # param( - [string]$Configuration="Debug") + [string]$Configuration="Debug", + [switch]$NoPackage) $env:CONFIGURATION = $Configuration; +if($NoPackage) +{ + $env:DOTNET_BUILD_SKIP_PACKAGING=1 +} +else +{ + $env:DOTNET_BUILD_SKIP_PACKAGING=0 +} + # Load Branch Info cat "$PSScriptRoot\..\branchinfo.txt" | ForEach-Object { if(!$_.StartsWith("#") -and ![String]::IsNullOrWhiteSpace($_)) { @@ -50,6 +60,7 @@ if($LASTEXITCODE -ne 0) { throw "Failed to compile build scripts" } # Run the builder Write-Host "Invoking Build Scripts..." +Write-Host " Configuration: $env:CONFIGURATION" $env:DOTNET_HOME="$env:DOTNET_INSTALL_DIR\cli" & "$PSScriptRoot\dotnet-cli-build\bin\dotnet-cli-build.exe" @args if($LASTEXITCODE -ne 0) { throw "Build failed" }