From 6349a198467c0b5cb9462f1ee9d7c6a47f797a16 Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Wed, 21 Oct 2015 11:24:23 -0700 Subject: [PATCH 1/9] Add xplat CI support --- netci.groovy | 96 +++++++++++++++++++++++++++++++++----------- scripts/ci_build.cmd | 3 ++ 2 files changed, 75 insertions(+), 24 deletions(-) create mode 100644 scripts/ci_build.cmd diff --git a/netci.groovy b/netci.groovy index 5df1b3b7a..f37f53af3 100644 --- a/netci.groovy +++ b/netci.groovy @@ -4,34 +4,82 @@ import jobs.generation.Utilities; import jobs.generation.InternalUtilities; def project = 'dotnet/cli' -// Define build strings -def debugBuildString = '''./build.sh''' -// Generate the builds for debug +def osList = ['Ubuntu', 'OSX', 'Windows_NT'] -def linuxDebugJob = job(InternalUtilities.getFullJobName(project, 'linux_debug', false)) { - label('ubuntu') - steps { - shell(debugBuildString) - } +def machineLabelMap = ['Ubuntu':'ubuntu', + 'OSX':'mac', + 'Windows_NT':'windows'] + +def static getBuildJobName(def configuration, def os) { + return configuration.toLowerCase() + '_' + os.toLowerCase() } -InternalUtilities.addPrivatePermissions(linuxDebugJob) -InternalUtilities.addPrivateScm(linuxDebugJob, project) -Utilities.addStandardOptions(linuxDebugJob) -Utilities.addStandardNonPRParameters(linuxDebugJob) -Utilities.addGithubPushTrigger(linuxDebugJob) + +['Debug', 'Release'].each { configuration -> + osList.each { os -> + // Calculate names + def lowerConfiguration = configuration.toLowerCase() + + // Calculate job name + def jobName = getBuildJobName(configuration, os) + def buildCommand = ''; + + def osGroup = osGroupMap[os] + + // Calculate the build command + if (os == 'Windows_NT') { + // On Windows we build the mscorlibs too. + buildCommand = ".\scripts\ci_build.cmd ${lowerConfiguration}" + } + else { + // On other OS's we skipmscorlib but run the pal tests + buildCommand = "./scripts/ci_build.sh ${lowerConfiguration}" + } + + // Create the new job + def newCommitJob = job(Utilities.getFullJobName(project, jobName, false)) { + // Set the label. + label(machineLabelMap[os]) + steps { + if (os == 'Windows_NT') { + // Batch + batchFile(buildCommand) + } + else { + // Shell + shell(buildCommand) + } + } + } + + InternalUtilities.addPrivatePermissions(newCommitJob) + InternalUtilities.addPrivateScm(newCommitJob, project) + Utilities.addStandardOptions(newCommitJob) + Utilities.addStandardNonPRParameters(newCommitJob) + Utilities.addGithubPushTrigger(newCommitJob) -def linuxDebugPRJob = job(InternalUtilities.getFullJobName(project, 'linux_debug', true)) { - label('ubuntu') - steps { - shell(debugBuildString) - } + def newPRJob = job(Utilities.getFullJobName(project, jobName, true)) { + // Set the label. + label(machineLabelMap[os]) + steps { + if (os == 'Windows_NT') { + // Batch + batchFile(buildCommand) + } + else { + // Shell + shell(buildCommand) + } + } + } + + + InternalUtilities.addPrivatePermissions(newPRJob) + InternalUtilities.addPrivatePRTestSCM(newPRJob, project) + Utilities.addStandardOptions(newPRJob) + Utilities.addStandardPRParameters(newPRJob, project) + Utilities.addGithubPRTrigger(newPRJob, "${os} ${configuration} Build") + } } - -InternalUtilities.addPrivatePermissions(linuxDebugPRJob) -InternalUtilities.addPrivatePRTestSCM(linuxDebugPRJob, project) -Utilities.addStandardOptions(linuxDebugPRJob) -Utilities.addStandardPRParameters(linuxDebugPRJob, project) -Utilities.addGithubPRTrigger(linuxDebugPRJob, 'Linux Debug Build') diff --git a/scripts/ci_build.cmd b/scripts/ci_build.cmd new file mode 100644 index 000000000..d3ad32cbc --- /dev/null +++ b/scripts/ci_build.cmd @@ -0,0 +1,3 @@ +@echo off + +CALL %~dp0..\build.cmd \ No newline at end of file From b2c3ef484f48dc40aab68a908a353ee7024ef68d Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Wed, 21 Oct 2015 12:05:39 -0700 Subject: [PATCH 2/9] Fix windows ci build script to exit with the correct exit code. --- scripts/ci_build.cmd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/ci_build.cmd b/scripts/ci_build.cmd index d3ad32cbc..091b21ad6 100644 --- a/scripts/ci_build.cmd +++ b/scripts/ci_build.cmd @@ -1,3 +1,5 @@ @echo off -CALL %~dp0..\build.cmd \ No newline at end of file +CALL %~dp0..\build.cmd %* + +exit /b %errorlevel% From 769ed7e5cafc6d9d949e2c8a6b8db37cfb9f9956 Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Wed, 21 Oct 2015 12:07:54 -0700 Subject: [PATCH 3/9] Add ci build script for unix --- scripts/ci_build.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 scripts/ci_build.sh diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh new file mode 100755 index 000000000..118fde9b6 --- /dev/null +++ b/scripts/ci_build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +source $SCRIPT_DIR/../build.sh $@ + +ret_code=$? +exit $ret_code + From a5599d8390ad6f9b941237fbd8c5188369e5af43 Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Wed, 21 Oct 2015 12:27:02 -0700 Subject: [PATCH 4/9] Escape '\' char in netci.groovy --- netci.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netci.groovy b/netci.groovy index f37f53af3..7ce7448f6 100644 --- a/netci.groovy +++ b/netci.groovy @@ -30,7 +30,7 @@ def static getBuildJobName(def configuration, def os) { // Calculate the build command if (os == 'Windows_NT') { // On Windows we build the mscorlibs too. - buildCommand = ".\scripts\ci_build.cmd ${lowerConfiguration}" + buildCommand = ".\\scripts\\ci_build.cmd ${lowerConfiguration}" } else { // On other OS's we skipmscorlib but run the pal tests From 05513e60e2079d908d6d16a103212b3e8834b6fb Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Wed, 21 Oct 2015 12:31:48 -0700 Subject: [PATCH 5/9] Remove missing variables reference. --- netci.groovy | 2 -- 1 file changed, 2 deletions(-) diff --git a/netci.groovy b/netci.groovy index 7ce7448f6..c75225dfd 100644 --- a/netci.groovy +++ b/netci.groovy @@ -25,8 +25,6 @@ def static getBuildJobName(def configuration, def os) { def jobName = getBuildJobName(configuration, os) def buildCommand = ''; - def osGroup = osGroupMap[os] - // Calculate the build command if (os == 'Windows_NT') { // On Windows we build the mscorlibs too. From 0dbc51890eb32ca908095bb4a47686334d348726 Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Wed, 21 Oct 2015 12:39:14 -0700 Subject: [PATCH 6/9] Using 'InternalUtilities.getFullJobName' instead of 'Utilities.getFullJobName' to generate the correct Jenkins project name. --- netci.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netci.groovy b/netci.groovy index c75225dfd..c80e9f24d 100644 --- a/netci.groovy +++ b/netci.groovy @@ -36,7 +36,7 @@ def static getBuildJobName(def configuration, def os) { } // Create the new job - def newCommitJob = job(Utilities.getFullJobName(project, jobName, false)) { + def newCommitJob = job(InternalUtilities.getFullJobName(project, jobName, false)) { // Set the label. label(machineLabelMap[os]) steps { @@ -58,7 +58,7 @@ def static getBuildJobName(def configuration, def os) { Utilities.addGithubPushTrigger(newCommitJob) - def newPRJob = job(Utilities.getFullJobName(project, jobName, true)) { + def newPRJob = job(InternalUtilities.getFullJobName(project, jobName, true)) { // Set the label. label(machineLabelMap[os]) steps { From 8b4df2d31fe4e235b82e75f59d56e52b54d1a9c3 Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Wed, 21 Oct 2015 13:47:53 -0700 Subject: [PATCH 7/9] Address PR feedback --- netci.groovy | 2 -- scripts/ci_build.sh | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/netci.groovy b/netci.groovy index c80e9f24d..aaaac5d63 100644 --- a/netci.groovy +++ b/netci.groovy @@ -27,11 +27,9 @@ def static getBuildJobName(def configuration, def os) { // Calculate the build command if (os == 'Windows_NT') { - // On Windows we build the mscorlibs too. buildCommand = ".\\scripts\\ci_build.cmd ${lowerConfiguration}" } else { - // On other OS's we skipmscorlib but run the pal tests buildCommand = "./scripts/ci_build.sh ${lowerConfiguration}" } diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index 118fde9b6..7a378a6b7 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -2,7 +2,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source $SCRIPT_DIR/../build.sh $@ +$SCRIPT_DIR/../build.sh $@ ret_code=$? exit $ret_code From 7339dbd5bf40bef7843631ed8b101045af434e25 Mon Sep 17 00:00:00 2001 From: glennc Date: Wed, 21 Oct 2015 14:02:47 -0700 Subject: [PATCH 8/9] Force package versions down temporarily while we move to dotnet. --- scripts/docker/Dockerfile | 6 ------ src/Microsoft.DotNet.Cli.Utils/project.json | 8 ++++---- src/Microsoft.DotNet.Cli/project.json | 10 +++++----- .../project.json | 14 +++++++------- .../project.json | 10 +++++----- .../project.json | 14 +++++++------- src/Microsoft.DotNet.Tools.Resgen/project.json | 18 +++++++++--------- .../project.json | 16 ++++++++-------- 8 files changed, 45 insertions(+), 51 deletions(-) diff --git a/scripts/docker/Dockerfile b/scripts/docker/Dockerfile index f8912388c..5e0b76d69 100644 --- a/scripts/docker/Dockerfile +++ b/scripts/docker/Dockerfile @@ -1,11 +1,5 @@ # Dockerfile that creates a container suitable to build dotnet-cli FROM microsoft/aspnet:1.0.0-beta8-coreclr -# Temporary: Install Mono, we use MCS to bootstrap -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF 2>&1 && \ - echo "deb http://download.mono-project.com/repo/debian nightly main" > /etc/apt/sources.list.d/mono-nightly.list && \ - apt-get -qqy update && \ - apt-get -qqy install mono-complete - # Set working directory WORKDIR /opt/code diff --git a/src/Microsoft.DotNet.Cli.Utils/project.json b/src/Microsoft.DotNet.Cli.Utils/project.json index f99a91d85..b6ff1d85e 100644 --- a/src/Microsoft.DotNet.Cli.Utils/project.json +++ b/src/Microsoft.DotNet.Cli.Utils/project.json @@ -4,10 +4,10 @@ "shared": "**/*.cs", "dependencies": { - "System.Console": "4.0.0-*", - "System.IO.FileSystem": "4.0.1-*", - "System.Diagnostics.Process": "4.1.0-*", - "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-*" + "System.Console": "4.0.0-beta-23419", + "System.IO.FileSystem": "4.0.1-beta-23419", + "System.Diagnostics.Process": "4.1.0-beta-23419", + "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23419" }, "frameworks": { "dnxcore50": { } diff --git a/src/Microsoft.DotNet.Cli/project.json b/src/Microsoft.DotNet.Cli/project.json index a3b316451..7e36f3044 100644 --- a/src/Microsoft.DotNet.Cli/project.json +++ b/src/Microsoft.DotNet.Cli/project.json @@ -8,12 +8,12 @@ "dotnet": "Microsoft.DotNet.Cli" }, "dependencies": { - "Microsoft.NETCore.Runtime": "1.0.1-beta-23413", + "Microsoft.NETCore.Runtime": "1.0.1-beta-23419", - "System.Console": "4.0.0-*", - "System.Collections": "4.0.11-*", - "System.Linq": "4.0.1-*", - "System.Diagnostics.Process": "4.1.0-*", + "System.Console": "4.0.0-beta-23419", + "System.Collections": "4.0.11-beta-23419", + "System.Linq": "4.0.1-beta-23419", + "System.Diagnostics.Process": "4.1.0-beta-23419", "Microsoft.DotNet.Cli.Utils": { "type": "build", "version": "1.0.0-*" diff --git a/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json b/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json index dd1d6e7c0..3b405a92a 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json +++ b/src/Microsoft.DotNet.Tools.Compiler.Csc/project.json @@ -8,14 +8,14 @@ "dotnet-compile-csc": "Microsoft.DotNet.Tools.Compiler.Csc" }, "dependencies": { - "Microsoft.NETCore.TestHost": "1.0.0-*", - "Microsoft.NETCore.Runtime": "1.0.1-beta-23413", + "Microsoft.NETCore.TestHost": "1.0.0-beta-23419", + "Microsoft.NETCore.Runtime": "1.0.1-beta-23419", - "System.Console": "4.0.0-*", - "System.Collections": "4.0.11-*", - "System.Linq": "4.0.1-*", - "System.Diagnostics.Process": "4.1.0-*", - "System.IO.FileSystem": "4.0.1-*", + "System.Console": "4.0.0-beta-23419", + "System.Collections": "4.0.11-beta-23419", + "System.Linq": "4.0.1-beta-23419", + "System.Diagnostics.Process": "4.1.0-beta-23419", + "System.IO.FileSystem": "4.0.1-beta-23419", "Microsoft.Extensions.ProjectModel": "1.0.0-*", "Microsoft.DotNet.Cli.Utils": { "type": "build", diff --git a/src/Microsoft.DotNet.Tools.Compiler/project.json b/src/Microsoft.DotNet.Tools.Compiler/project.json index 9680c409b..890337c63 100644 --- a/src/Microsoft.DotNet.Tools.Compiler/project.json +++ b/src/Microsoft.DotNet.Tools.Compiler/project.json @@ -11,11 +11,11 @@ "Microsoft.NETCore.TestHost": "1.0.0-*", "Microsoft.NETCore.Runtime": "1.0.1-beta-23413", - "System.Console": "4.0.0-*", - "System.Collections": "4.0.11-*", - "System.Linq": "4.0.1-*", - "System.Diagnostics.Process": "4.1.0-*", - "System.IO.FileSystem": "4.0.1-*", + "System.Console": "4.0.0-beta-23419", + "System.Collections": "4.0.11-beta-23419", + "System.Linq": "4.0.1-beta-23419", + "System.Diagnostics.Process": "4.1.0-beta-23419", + "System.IO.FileSystem": "4.0.1-beta-23419", "Microsoft.Extensions.ProjectModel": "1.0.0-*", "Microsoft.DotNet.Cli.Utils": { "type": "build", diff --git a/src/Microsoft.DotNet.Tools.Publish/project.json b/src/Microsoft.DotNet.Tools.Publish/project.json index c1464c637..0fc9c1cb4 100644 --- a/src/Microsoft.DotNet.Tools.Publish/project.json +++ b/src/Microsoft.DotNet.Tools.Publish/project.json @@ -8,12 +8,12 @@ "dotnet-publish": "Microsoft.DotNet.Tools.Publish" }, "dependencies": { - "Microsoft.NETCore.Runtime": "1.0.1-beta-23413", - "System.Console": "4.0.0-*", - "System.Collections": "4.0.11-*", - "System.Linq": "4.0.1-*", - "System.Diagnostics.Process": "4.1.0-*", - "System.IO.FileSystem": "4.0.1-*", + "Microsoft.NETCore.Runtime": "1.0.1-beta-23419", + "System.Console": "4.0.0-beta-23419", + "System.Collections": "4.0.11-beta-23419", + "System.Linq": "4.0.1-beta-23419", + "System.Diagnostics.Process": "4.1.0-beta-23419", + "System.IO.FileSystem": "4.0.1-beta-23419", "Microsoft.Extensions.ProjectModel": "1.0.0-*", "Microsoft.DotNet.Cli.Utils": { "type": "build", @@ -23,7 +23,7 @@ "type": "build", "version": "1.0.0-*" }, - "System.AppContext": "4.0.1-*" + "System.AppContext": "4.0.1-beta-23419" }, "frameworks": { "dnxcore50": { } diff --git a/src/Microsoft.DotNet.Tools.Resgen/project.json b/src/Microsoft.DotNet.Tools.Resgen/project.json index e7c5af064..671fb1215 100644 --- a/src/Microsoft.DotNet.Tools.Resgen/project.json +++ b/src/Microsoft.DotNet.Tools.Resgen/project.json @@ -8,13 +8,13 @@ "resgen": "Microsoft.DotNet.Tools.Resgen" }, "dependencies": { - "Microsoft.NETCore.TestHost": "1.0.0-*", - "Microsoft.NETCore.Runtime": "1.0.1-beta-23413", - "System.Console": "4.0.0-*", - "System.Collections": "4.0.11-*", - "System.Linq": "4.0.1-*", - "System.Diagnostics.Process": "4.1.0-*", - "System.IO.FileSystem": "4.0.1-*", + "Microsoft.NETCore.TestHost": "1.0.0-beta-23419", + "Microsoft.NETCore.Runtime": "1.0.1-beta-23419", + "System.Console": "4.0.0-beta-23419", + "System.Collections": "4.0.11-beta-23419", + "System.Linq": "4.0.1-beta-23419", + "System.Diagnostics.Process": "4.1.0-beta-23419", + "System.IO.FileSystem": "4.0.1-beta-23419", "Microsoft.DotNet.Cli.Utils": { "type": "build", "version": "1.0.0-*" @@ -23,8 +23,8 @@ "type": "build", "version": "1.0.0-*" }, - "System.Xml.XDocument": "4.0.11-*", - "System.Resources.ReaderWriter": "4.0.0-*" + "System.Xml.XDocument": "4.0.11-beta-23419", + "System.Resources.ReaderWriter": "4.0.0-beta-23419" }, "frameworks": { "dnxcore50": { } diff --git a/src/Microsoft.Extensions.ProjectModel/project.json b/src/Microsoft.Extensions.ProjectModel/project.json index 8feeba45e..36f4f8149 100644 --- a/src/Microsoft.Extensions.ProjectModel/project.json +++ b/src/Microsoft.Extensions.ProjectModel/project.json @@ -3,18 +3,18 @@ "description": "Types to model a .NET Project", "dependencies": { - "Microsoft.CSharp": "4.0.1-*", - "System.Collections": "4.0.11-*", - "System.Linq": "4.0.1-*", - "System.Threading.Thread": "4.0.0-*", - "System.Runtime.Loader": "4.0.0-*", - "System.Dynamic.Runtime": "4.0.11-*", - "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-*", + "Microsoft.CSharp": "4.0.1-beta-23419", + "System.Collections": "4.0.11-beta-23419", + "System.Linq": "4.0.1-beta-23419", + "System.Threading.Thread": "4.0.0-beta-23419", + "System.Runtime.Loader": "4.0.0-beta-23419", + "System.Dynamic.Runtime": "4.0.11-beta-23419", + "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23419", "NuGet.Packaging": "3.2.0", "System.Security.Cryptography.Algorithms": "4.0.0-beta-23401", - "Microsoft.Extensions.FileSystemGlobbing": "1.0.0-*", + "Microsoft.Extensions.FileSystemGlobbing": "1.0.0-beta-23419", "Microsoft.Extensions.JsonParser.Sources": { "type": "build", "version": "1.0.0-*" From 10f1b6240a39d18a3511fca06c529ff917ae8a1b Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Wed, 21 Oct 2015 15:47:45 -0700 Subject: [PATCH 9/9] Update README.md Add build status badges --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 5ace6e6ee..c0aab2a2a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ # .NET Command Line Interface +Build Status +------------ + +| |Ubuntu 14.04 |Windows |Mac OS X | +|---------|:------:|:------:|:------:|:------:|:-------:|:-------:| +|**Debug**|[![Build Status](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_debug_ubuntu/badge/icon)](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_debug_ubuntu/)|[![Build Status](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_debug_windows_nt/badge/icon)](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_debug_windows_nt/)|[![Build Status](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_debug_osx/badge/icon)](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_debug_osx/) | +|**Release**|[![Build Status](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_release_ubuntu/badge/icon)](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_release_ubuntu/)|[![Build Status](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_release_windows_nt/badge/icon)](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_release_windows_nt/)|[![Build Status](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_release_osx/badge/icon)](http://dotnet-ci.cloudapp.net/job/Private/job/dotnet_cli_release_osx/) | + + + ## Building/Running 1. Run `build.cmd` or `build.sh` from the root