mirror of https://gitee.com/bigwinds/arangodb
Feature/jenkins pipeline (#3314)
* propagate exit result * added useDocker * added missing tests and directories * show arangosh version
This commit is contained in:
parent
9fe558ed5f
commit
0ab55310c6
|
@ -106,6 +106,9 @@ useMaintainer = params.Maintainer
|
|||
// build user mode
|
||||
useUser = params.User
|
||||
|
||||
// build docker
|
||||
useDocker = true
|
||||
|
||||
// run resilience tests
|
||||
//runResilience = params.runResilience
|
||||
|
||||
|
@ -283,6 +286,10 @@ def deleteDirDocker(os) {
|
|||
deleteDir()
|
||||
}
|
||||
|
||||
def shellAndPipe(command, logfile) {
|
||||
sh "(echo 1 > \"${logfile}.result\" ; ${command} ; echo \$? > \"${logfile}.result\") 2>&1 | tee -a \"${logfile}\" ; exit `cat \"${logfile}.result\"`"
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- SCRIPTS SCM
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -462,14 +469,16 @@ def checkCommitMessages() {
|
|||
]
|
||||
}
|
||||
else {
|
||||
echo "build of branch"
|
||||
|
||||
useDocker = false
|
||||
|
||||
restrictions = [
|
||||
// OS EDITION MAINTAINER
|
||||
"build-linux-community-user" : true,
|
||||
"build-linux-enterprise-maintainer" : true,
|
||||
|
||||
// OS EDITION MAINTAINER MODE ENGINE
|
||||
"test-linux-enterprise-maintainer-cluster-rocksdb" : true,
|
||||
"test-linux-community-user-singleserver-mmfiles" : true
|
||||
"test-linux-enterprise-maintainer-cluster-rocksdb" : true
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -511,6 +520,7 @@ Building Community: ${useCommunity}
|
|||
Building Enterprise: ${useEnterprise}
|
||||
Building Maintainer: ${useMaintainer}
|
||||
Building Non-Maintainer: ${useUser}
|
||||
Building Docker: ${useDocker}
|
||||
Running Tests: ${runTests}
|
||||
"""
|
||||
}
|
||||
|
@ -584,7 +594,7 @@ def jslint(os, edition, maintainer) {
|
|||
def logFile = "${arch}/jslint.log"
|
||||
|
||||
try {
|
||||
sh "./Installation/Pipeline/test_jslint.sh 2>&1 | tee ${logFile}"
|
||||
shellAndPipe("./Installation/Pipeline/test_jslint.sh",logFile)
|
||||
sh "if grep ERROR ${logFile}; then exit 1; fi"
|
||||
}
|
||||
catch (exc) {
|
||||
|
@ -651,6 +661,12 @@ def getTests(os, edition, maintainer, mode, engine) {
|
|||
}
|
||||
}
|
||||
|
||||
if (mode == "cluster") {
|
||||
tests += [
|
||||
["resilience", "resilience", ""]
|
||||
]
|
||||
}
|
||||
|
||||
return tests
|
||||
}
|
||||
|
||||
|
@ -659,7 +675,7 @@ def setupTestEnvironment(os, edition, maintainer, logFile, runDir) {
|
|||
folderCreateOperation("${runDir}/tmp"),
|
||||
])
|
||||
|
||||
def subdirs = ['build', 'etc', 'js', 'UnitTests']
|
||||
def subdirs = ['build', 'etc', 'js', 'scripts', 'UnitTests']
|
||||
|
||||
if (edition == "enterprise") {
|
||||
subdirs << "enterprise"
|
||||
|
@ -745,14 +761,15 @@ def executeTests(os, edition, maintainer, mode, engine, portInit, archDir, arch,
|
|||
powershell "cd ${runDir} ; ${command} | Add-Content -PassThru ${logFile}"
|
||||
}
|
||||
else {
|
||||
sh "echo \"Host: `hostname`\" | tee ${logFile}"
|
||||
sh "echo \"Host: `hostname`\" | tee -a ${logFile}"
|
||||
sh "echo \"PWD: `pwd`\" | tee -a ${logFile}"
|
||||
sh "echo \"Date: `date`\" | tee -a ${logFile}"
|
||||
|
||||
command = "(cd ${runDir} ; echo 1 > result ; ${command} ; echo \$? > result) 2>&1 | " +
|
||||
"tee -a ${logFile} ; exit `cat ${runDir}/result`"
|
||||
shellAndPipe("cd ${runDir} ; ./build/bin/arangosh --version", logFile)
|
||||
|
||||
command = "(cd ${runDir} ; ${command})"
|
||||
echo "executing ${command}"
|
||||
sh command
|
||||
shellAndPipe(command, logFile)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1032,7 +1049,7 @@ def buildEdition(os, edition, maintainer) {
|
|||
|
||||
try {
|
||||
if (os == 'linux' || os == 'mac') {
|
||||
sh "echo \"Host: `hostname`\" | tee ${logFile}"
|
||||
sh "echo \"Host: `hostname`\" | tee -a ${logFile}"
|
||||
sh "echo \"PWD: `pwd`\" | tee -a ${logFile}"
|
||||
sh "echo \"Date: `date`\" | tee -a ${logFile}"
|
||||
|
||||
|
@ -1145,9 +1162,9 @@ def createDockerImage(edition, maintainer, stageName) {
|
|||
|
||||
withEnv(["DOCKERTAG=${packageName}-${dockerTag}"]) {
|
||||
try {
|
||||
sh "scripts/build-docker.sh 2>&1 | tee ${logFile}"
|
||||
sh "docker tag arangodb:${packageName}-${dockerTag} c1.triagens-gmbh.zz:5000/arangodb/${packageName}:${dockerTag} 2>&1 | tee -a ${logFile}"
|
||||
sh "docker push c1.triagens-gmbh.zz:5000/arangodb/${packageName}:${dockerTag} 2>&1 | tee -a ${logFile}"
|
||||
shellAndPipe("./scripts/build-docker.sh", logFile)
|
||||
shellAndPipe("docker tag arangodb:${packageName}-${dockerTag} c1.triagens-gmbh.zz:5000/arangodb/${packageName}:${dockerTag}", logFile)
|
||||
shellAndPipe("docker push c1.triagens-gmbh.zz:5000/arangodb/${packageName}:${dockerTag}", logFile)
|
||||
}
|
||||
catch (exc) {
|
||||
renameFolder(arch, archFail)
|
||||
|
@ -1228,7 +1245,7 @@ def runOperatingSystems(osList) {
|
|||
def stageName = "build-${name}"
|
||||
branches[stageName] = runEdition(os, edition, maintainer, stageName)
|
||||
|
||||
if (os == 'linux') {
|
||||
if (os == 'linux' && useDocker) {
|
||||
branches["docker-${name}"] = createDockerImage(edition, maintainer, "docker-${name}")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue