From 26fb31ec645dc3ff6f2208b6d4f77cadc839ad0e Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 21:39:32 +0200 Subject: [PATCH 01/14] added Docker --- Installation/Pipeline/Jenkinsfile.groovy | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index ff9110f20f16..5881a06beb11 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -11,6 +11,7 @@ def defaultLinux = true def defaultMac = false def defaultWindows = false def defaultBuild = true +def defaultDocker = false def defaultCleanBuild = false def defaultCommunity = true def defaultEnterprise = true @@ -36,6 +37,11 @@ properties([ description: 'build and run tests in Windows', name: 'Windows' ), + booleanParam( + defaultValue: defaultDocker, + description: 'build docker images', + name: 'Docker' + ), booleanParam( defaultValue: defaultCleanBuild, description: 'clean build directories', @@ -86,6 +92,9 @@ useMac = params.Mac // build windows useWindows = params.Windows +// build docker image +useDocker = params.Docker + // build and test community useCommunity = params.Community @@ -98,9 +107,6 @@ useMaintainer = params.Maintainer // build user mode useUser = params.User -// build docker -useDocker = true - // run resilience tests //runResilience = params.runResilience @@ -385,7 +391,7 @@ def generateResult() { def diff = (start != "" && stop != "") ? groovy.time.TimeCategory.minus(stop, start) : "-" def startf = start == "" ? "-" : start.format('yyyy/MM/dd HH:mm:ss') def stopf = stop == "" ? "-" : stop.format('yyyy/MM/dd HH:mm:ss') - def color = 'bgcolor="#FF8080"' + def color = 'bgcolor="#FFA0A0"' def la = "" def lb = "" @@ -396,10 +402,10 @@ def generateResult() { } if (msg == "finished") { - color = 'bgcolor="#80FF80"' + color = 'bgcolor="#A0FFA0"' } else if (msg == "started") { - color = 'bgcolor="#8080FF"' + color = 'bgcolor="#A0A0FF"' la = "" lb = "" } From 9b179823b805d4035e1ae89f57ddb60dbaf35276 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 21:45:54 +0200 Subject: [PATCH 02/14] moved tests --- Installation/Pipeline/Jenkinsfile.groovy | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index 5881a06beb11..8a1dafc46e07 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -1018,7 +1018,9 @@ def executeTests(os, edition, maintainer, mode, engine, stageName) { testIndex++ - testMap["${stageName}-${name}"] = singleTest(os, edition, maintainer, mode, engine, test, testArgs, testIndex, stageName, name, port) + testMap["${stageName}-${name}"] = singleTest(os, edition, maintainer, mode, engine, + test, testArgs, testIndex, + stageName, name, port) return testMap } @@ -1428,9 +1430,9 @@ def runEdition(os, edition, maintainer, stageName) { } } } - - testStepParallel(os, edition, maintainer, ['cluster', 'singleserver']) } + + testStepParallel(os, edition, maintainer, ['cluster', 'singleserver']) } } From 6d30e8e686443890af8949e555449a227da2d549 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 22:28:04 +0200 Subject: [PATCH 03/14] cleanup --- Installation/Pipeline/Jenkinsfile.groovy | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index 8a1dafc46e07..7c651ef73153 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -1252,21 +1252,6 @@ def buildEdition(os, edition, maintainer) { } } else if (os == 'windows') { - // def tmpDir = "${arch}/tmp" - - // fileOperations([ - // folderCreateOperation(tmpDir) - // ]) - - // withEnv(["TMPDIR=${tmpDir}", "TEMPDIR=${tmpDir}", "TMP=${tmpDir}", - // "_MSPDBSRV_ENDPOINT_=${edition}-${env.BUILD_TAG}", "GYP_USE_SEPARATE_MSPDBSRV=1"]) { - // powershell ". .\\Installation\\Pipeline\\windows\\build_${os}_${edition}.ps1" - // } - - // fileOperations([ - // folderDeleteOperation(tmpDir) - // ]) - powershell ". .\\Installation\\Pipeline\\windows\\build_${os}_${edition}_${maintainer}.ps1" } From 91bcb1f27c170af98b1e5b133468a2b1f4893c85 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 22:29:30 +0200 Subject: [PATCH 04/14] use cluster mmfiles --- Installation/Pipeline/Jenkinsfile.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index 7c651ef73153..299ad8d4b147 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -612,7 +612,8 @@ def checkCommitMessages() { "build-linux-enterprise-maintainer" : true, // OS EDITION MAINTAINER MODE ENGINE - "test-linux-enterprise-maintainer-cluster-rocksdb" : true + "test-linux-enterprise-maintainer-singleserver-rocksdb" : true, + "test-linux-enterprise-maintainer-cluster-mmfiles" : true ] } } From 62796efd597de7dfa1972f20e9b39ea67f85af7a Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 22:43:47 +0200 Subject: [PATCH 05/14] added ts --- Installation/Pipeline/Jenkinsfile.groovy | 26 +++++++++---------- .../Pipeline/build_OS_EDITION_MAINTAINER.sh | 19 ++++---------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index 299ad8d4b147..249740a87d31 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -322,7 +322,7 @@ def deleteDirDocker(os) { } def shellAndPipe(command, logfile) { - sh "(echo 1 > \"${logfile}.result\" ; ${command} ; echo \$? > \"${logfile}.result\") 2>&1 | tee -a \"${logfile}\" ; exit `cat \"${logfile}.result\"`" + sh "(echo 1 > \"${logfile}.result\" ; ${command} ; echo \$? > \"${logfile}.result\") 2>&1 | ts '[%Y-%m-%d %H:%M:%S]' | tee -a \"${logfile}\" ; exit `cat \"${logfile}.result\"`" } def logStartStage(os, logFile, link) { @@ -335,7 +335,7 @@ def logStartStage(os, logFile, link) { echo "started ${logFile}: ${resultsStart[logFile]}" if (os == "linux") { - sh "echo 'started ${logFile}: ${resultsStart[logFile]}' | tee -a ${logFile}" + sheelAndPipe("echo 'started ${logFile}: ${resultsStart[logFile]}'") } generateResult() @@ -348,7 +348,7 @@ def logStopStage(os, logFile) { echo "finished ${logFile}: ${resultsStop[logFile]}" if (os == "linux") { - sh "echo 'finished ${logFile}: ${resultsStop[logFile]}' | tee -a ${logFile}" + shellAndPipe("echo 'finished ${logFile}: ${resultsStop[logFile]}'", logFile) } generateResult() @@ -367,7 +367,7 @@ def logExceptionStage(os, logFile, link, exc) { echo "failed ${logFile}: ${resultsStop[logFile]} ${msg}" if (os == "linux") { - sh "echo 'failed ${logFile}: ${resultsStart[logFile]} ${msg}' | tee -a ${logFile}" + shellAndPipe("echo 'failed ${logFile}: ${resultsStart[logFile]} ${msg}'", logFile) } generateResult() @@ -767,7 +767,7 @@ def jslint(os, edition, maintainer) { try { logStartStage(os, logFile, logFile) - shellAndPipe("./Installation/Pipeline/test_jslint.sh",logFile) + shellAndPipe("./Installation/Pipeline/test_jslint.sh", logFile) sh "if grep ERROR ${logFile}; then exit 1; fi" logStopStage(os, logFile) @@ -923,9 +923,9 @@ def singleTest(os, edition, maintainer, mode, engine, test, testArgs, testIndex, powershell "cd ${runDir} ; ${command} | Add-Content -PassThru ${logFile}" } else { - sh "echo \"Host: `hostname`\" | tee -a ${logFile}" - sh "echo \"PWD: `pwd`\" | tee -a ${logFile}" - sh "echo \"Date: `date`\" | tee -a ${logFile}" + shellAndPipe("echo \"Host: `hostname`\"", logFile) + shellAndPipe("echo \"PWD: `pwd`\"", logFile) + shellAndPipe("echo \"Date: `date`\"", logFile) shellAndPipe("cd ${runDir} ; ./build/bin/arangosh --version", logFile) @@ -1241,15 +1241,15 @@ def buildEdition(os, edition, maintainer) { unstashBuild(os, edition, maintainer) } - sh "echo \"Host: `hostname`\" | tee -a ${logFile}" - sh "echo \"PWD: `pwd`\" | tee -a ${logFile}" - sh "echo \"Date: `date`\" | tee -a ${logFile}" + shellAndPipe("echo \"Host: `hostname`\"", logFile) + shellAndPipe("echo \"PWD: `pwd`\"", logFile) + shellAndPipe("echo \"Date: `date`\"", logFile) if (os == 'linux') { - sh "./Installation/Pipeline/build_OS_EDITION_MAINTAINER.sh 64 ${os} ${edition} ${maintainer} ${arch}" + shellAndPipe("./Installation/Pipeline/build_OS_EDITION_MAINTAINER.sh 64 ${os} ${edition} ${maintainer}", logFile) } else if (os == 'mac') { - sh "./Installation/Pipeline/build_OS_EDITION_MAINTAINER.sh 16 ${os} ${edition} ${maintainer} ${arch}" + shellAndPipe("./Installation/Pipeline/build_OS_EDITION_MAINTAINER.sh 16 ${os} ${edition} ${maintainer}", logFile) } } else if (os == 'windows') { diff --git a/Installation/Pipeline/build_OS_EDITION_MAINTAINER.sh b/Installation/Pipeline/build_OS_EDITION_MAINTAINER.sh index 99ec2c0e5954..78c2ba9a593f 100755 --- a/Installation/Pipeline/build_OS_EDITION_MAINTAINER.sh +++ b/Installation/Pipeline/build_OS_EDITION_MAINTAINER.sh @@ -3,7 +3,6 @@ concurrency=$1 os=$2 edition=$3 maintainer=$4 -logdir=$5 ENTERPRISE="" type="build" @@ -62,17 +61,9 @@ rm -f $GENPATH ln -s `pwd` $GENPATH cd $GENPATH -if [ -z "$logdir" ]; then - logdir=log-output - rm -rf $logdir - mkdir -p $logdir -fi - -touch $logdir/build.log - -echo "CONCURRENY: $concurrency" | tee -a $logdir/build.log -echo "HOST: `hostname`" | tee -a $logdir/build.log -echo "PWD: `pwd`" | tee -a $logdir/build.log +echo "CONCURRENY: $concurrency" +echo "HOST: `hostname`" +echo "PWD: `pwd`" ( set -eo pipefail @@ -88,10 +79,10 @@ echo "PWD: `pwd`" | tee -a $logdir/build.log $ENTERPRISE \ $MAINTAINER \ $PACKAGING \ - .. 2>&1 | tee -a ../$logdir/build.log + .. echo "`date +%T` building..." - make -j $concurrency -l $load 2>&1 | tee -a ../$logdir/build.log + make -j $concurrency -l $load 2>&1 ) || exit 1 echo "`date +%T` done..." From d7dac66693ff0f59c61d3e044b2d8c91b444b0c9 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 22:55:59 +0200 Subject: [PATCH 06/14] fixed empty tests --- Installation/Pipeline/Jenkinsfile.groovy | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index 0ceb1858dad9..08226f27edd2 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -398,7 +398,7 @@ def generateResult() { def la = "" def lb = "" - if (link != null) { + if (link != "") { la = "" lb = "" } @@ -1082,14 +1082,16 @@ def testStepParallel(os, edition, maintainer, modeList) { def name = "test-${os}-${edition}-${maintainer}" - try { - logStartStage(null, name, null) - parallel branches - logStopStage(null, name) - } - catch (exc) { - logExceptionStage(null, name, null, exc) - throw exc + if (branches) { + try { + logStartStage(null, name, null) + parallel branches + logStopStage(null, name) + } + catch (exc) { + logExceptionStage(null, name, null, exc) + throw exc + } } } From 1a3c44fcaf33a197ab988a8c015146a93d3c27cb Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 23:02:53 +0200 Subject: [PATCH 07/14] fixed wrong call --- Installation/Pipeline/Jenkinsfile.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index 08226f27edd2..f7c1d80ad19d 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -1419,9 +1419,9 @@ def runEdition(os, edition, maintainer, stageName) { } } } - } - testStepParallel(os, edition, maintainer, ['cluster', 'singleserver']) + testStepParallel(os, edition, maintainer, ['cluster', 'singleserver']) + } } } From 78adcec4c19d8c6fa8b72715de46c8c2bd570e3e Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 23:10:24 +0200 Subject: [PATCH 08/14] delete in case of failure --- Installation/Pipeline/Jenkinsfile.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index f7c1d80ad19d..808ff5f1f6ea 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -450,6 +450,7 @@ def checkoutCommunity(os) { } catch (exc) { echo "GITHUB checkout failed, retrying in 1min" + deleteDirDocker(os) sleep 60 throw exc } From 38ef682ceb342fdbc0d201d2aca1a739a92fc2ac Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 23:12:56 +0200 Subject: [PATCH 09/14] delete in case of failure --- Installation/Pipeline/Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index 808ff5f1f6ea..09c70212ec59 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -450,7 +450,7 @@ def checkoutCommunity(os) { } catch (exc) { echo "GITHUB checkout failed, retrying in 1min" - deleteDirDocker(os) + deleteDir() sleep 60 throw exc } From 6a8c1c486657cfebae37691c20dadb4d332332e4 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 23:20:05 +0200 Subject: [PATCH 10/14] fixed escaping --- Installation/Pipeline/Jenkinsfile.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index 09c70212ec59..6318eefeb6ea 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -324,7 +324,9 @@ def deleteDirDocker(os) { } def shellAndPipe(command, logfile) { - sh "(echo 1 > \"${logfile}.result\" ; ${command} ; echo \$? > \"${logfile}.result\") 2>&1 | ts '[%Y-%m-%d %H:%M:%S]' | tee -a \"${logfile}\" ; exit `cat \"${logfile}.result\"`" + def cmd = command.replaceAll(/"/, "\\\"") + + sh "(echo 1 > \"${logfile}.result\" ; ${cmd} ; echo \$? > \"${logfile}.result\") 2>&1 | ts '[%Y-%m-%d %H:%M:%S]' | tee -a \"${logfile}\" ; exit `cat \"${logfile}.result\"`" } def logStartStage(os, logFile, link) { From c93edd918db9c102fe9a5bab7c26499ed8828327 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 23:26:56 +0200 Subject: [PATCH 11/14] fixed escaping --- Installation/Pipeline/Jenkinsfile.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index 6318eefeb6ea..ddc648238755 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -326,6 +326,7 @@ def deleteDirDocker(os) { def shellAndPipe(command, logfile) { def cmd = command.replaceAll(/"/, "\\\"") + echo "executing ${cmd}" sh "(echo 1 > \"${logfile}.result\" ; ${cmd} ; echo \$? > \"${logfile}.result\") 2>&1 | ts '[%Y-%m-%d %H:%M:%S]' | tee -a \"${logfile}\" ; exit `cat \"${logfile}.result\"`" } From f6c85623799007c62b46327e468f05a91079d24b Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 23:33:44 +0200 Subject: [PATCH 12/14] fixed escaping --- Installation/Pipeline/Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index ddc648238755..83f81d81d2f4 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -340,7 +340,7 @@ def logStartStage(os, logFile, link) { echo "started ${logFile}: ${resultsStart[logFile]}" if (os == "linux") { - sheelAndPipe("echo 'started ${logFile}: ${resultsStart[logFile]}'") + shellAndPipe("echo 'started ${logFile}: ${resultsStart[logFile]}'") } generateResult() From 5174ec1186acce9a8277895ce3cf487e8e219613 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 23:35:13 +0200 Subject: [PATCH 13/14] fixed escaping --- Installation/Pipeline/Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index 83f81d81d2f4..3513d1209769 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -340,7 +340,7 @@ def logStartStage(os, logFile, link) { echo "started ${logFile}: ${resultsStart[logFile]}" if (os == "linux") { - shellAndPipe("echo 'started ${logFile}: ${resultsStart[logFile]}'") + shellAndPipe("echo 'started ${logFile}: ${resultsStart[logFile]}'", logfile) } generateResult() From a7b9a72fb77231f6438eb248d4cac24d6b922e73 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 27 Sep 2017 23:38:24 +0200 Subject: [PATCH 14/14] fixed escaping --- Installation/Pipeline/Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/Pipeline/Jenkinsfile.groovy b/Installation/Pipeline/Jenkinsfile.groovy index 3513d1209769..5a22e3a2dc16 100644 --- a/Installation/Pipeline/Jenkinsfile.groovy +++ b/Installation/Pipeline/Jenkinsfile.groovy @@ -340,7 +340,7 @@ def logStartStage(os, logFile, link) { echo "started ${logFile}: ${resultsStart[logFile]}" if (os == "linux") { - shellAndPipe("echo 'started ${logFile}: ${resultsStart[logFile]}'", logfile) + shellAndPipe("echo 'started ${logFile}: ${resultsStart[logFile]}'", logFile) } generateResult()