1
0
Fork 0

Feature/jenkins pipeline (#2996)

* added restrictions
This commit is contained in:
Frank Celler 2017-08-08 16:06:05 +02:00 committed by GitHub
parent 6c3bc05419
commit 979c18016a
1 changed files with 57 additions and 24 deletions

View File

@ -202,9 +202,9 @@ def checkoutCommunity() {
sh 'git clean -f -d -x'
}
catch (exc) {
echo "GITHUB checkout failed, retrying in 5min"
echo "GITHUB checkout failed, retrying in 1min"
echo exc.toString()
sleep 300
sleep 60
}
}
}
@ -258,6 +258,8 @@ def checkoutResilience() {
}
def checkCommitMessages() {
def causes = currentBuild.rawBuild.getCauses()
def causeDescription = causes[0].getShortDescription();
def changeLogSets = currentBuild.changeSets
def seenCommit = false
def skip = false
@ -299,7 +301,10 @@ def checkCommitMessages() {
}
}
if (skip) {
if (causeDescription =~ /Started by user/) {
echo "build started by user"
}
else if (skip) {
useLinux = false
useMac = false
useWindows = false
@ -310,7 +315,7 @@ def checkCommitMessages() {
runResilience = false
runTests = false
}
else if (seenCommit) {
else {
if (env.BRANCH_NAME == "devel" || env.BRANCH_NAME == "3.2") {
useLinux = true
useMac = true
@ -332,25 +337,43 @@ def checkCommitMessages() {
runJslint = true
runResilience = true
runTests = true
restrictions = [
"build-community-linux" : true,
"build-community-mac" : true,
// "build-community-windows" : true,
"build-enterprise-linux" : true,
"build-enterprise-mac" : true,
"build-enterprise-windows" : true,
"test-cluster-community-mmfiles-linux" : true,
"test-cluster-community-rocksdb-linux" : true,
"test-cluster-enterprise-mmfiles-linux" : true,
"test-cluster-enterprise-rocksdb-linux" : true,
"test-singleserver-community-mmfiles-linux" : true,
"test-singleserver-community-rocksdb-linux" : true,
"test-singleserver-enterprise-mmfiles-linux" : true,
"test-singleserver-enterprise-rocksdb-linux" : true
]
}
else {
useLinux = true
useMac = true
useWindows = true
buildExecutable = true
fullParallel = true
useCommunity = true
useEnterprise = true
runJslint = true
runResilience = false
runTests = false
runResilience = true
runTests = true
restrictions = [
"build-enterprise-linux",
"build-community-mac",
"build-community-windows",
"test-cluster-enterprise-rocksdb-linux",
"test-singleserver-community-mmfiles-mac",
"test-singleserver-community-rocksdb-windows"
"build-community-mac" : true,
// "build-community-windows" : true,
"build-enterprise-linux" : true,
"test-cluster-enterprise-rocksdb-linux" : true,
"test-singleserver-community-mmfiles-mac" : true
// "test-singleserver-community-rocksdb-windows" : true
]
}
}
@ -360,6 +383,7 @@ SOURCE: ${sourceBranchLabel}
CHANGE_ID: ${env.CHANGE_ID}
CHANGE_TARGET: ${env.CHANGE_TARGET}
JOB_NAME: ${env.JOB_NAME}
CAUSE: ${causeDescription}
Linux: ${useLinux}
Mac: ${useMac}
@ -371,7 +395,10 @@ Building Community: ${useCommunity}
Building Enterprise: ${useEnterprise}
Running Jslint: ${runJslint}
Running Resilience: ${runResilience}
Running Tests: ${runTests}"""
Running Tests: ${runTests}
Restrictions: ${restrictions.keySet().join(", ")}
"""
}
// -----------------------------------------------------------------------------
@ -593,9 +620,7 @@ def testEdition(edition, os, mode, engine) {
}
}
def testCheck(edition, os, mode, engine, full) {
def name = "${edition}-${os}"
def testCheck(edition, os, mode, engine) {
if (! runTests) {
return false
}
@ -620,6 +645,10 @@ def testCheck(edition, os, mode, engine, full) {
return false
}
if (restrictions && !restrictions["test-${mode}-${edition}-${engine}-${os}"]) {
return false
}
return true
}
@ -652,13 +681,12 @@ def testStep(edition, os, mode, engine) {
def testStepParallel(editionList, osList, modeList) {
def branches = [:]
def full = false
for (edition in editionList) {
for (os in osList) {
for (mode in modeList) {
for (engine in ['mmfiles', 'rocksdb']) {
if (testCheck(edition, os, mode, engine, full)) {
if (testCheck(edition, os, mode, engine)) {
def name = "test-${mode}-${edition}-${engine}-${os}";
branches[name] = testStep(edition, os, mode, engine)
@ -701,9 +729,7 @@ def testResilience(os, engine, foxx) {
}
}
def testResilienceCheck(os, engine, foxx, full) {
def name = "community-${os}"
def testResilienceCheck(os, engine, foxx) {
if (! runResilience) {
return false
}
@ -724,6 +750,10 @@ def testResilienceCheck(os, engine, foxx, full) {
return false
}
if (restrictions && !restrictions["test-resilience-${foxx}-${engine}-${os}"]) {
return false
}
return true
}
@ -797,12 +827,11 @@ def testResilienceStep(os, engine, foxx) {
def testResilienceParallel(osList) {
def branches = [:]
def full = false
for (foxx in ['foxx', 'nofoxx']) {
for (os in osList) {
for (engine in ['mmfiles', 'rocksdb']) {
if (testResilienceCheck(os, engine, foxx, full)) {
if (testResilienceCheck(os, engine, foxx)) {
def name = "test-resilience-${foxx}-${engine}-${os}"
branches[name] = testResilienceStep(os, engine, foxx)
@ -850,7 +879,7 @@ def buildEdition(edition, os) {
sh "./Installation/Pipeline/linux/build_${edition}_${os}.sh 64"
}
else if (os == 'mac') {
sh "./Installation/Pipeline/mac/build_${edition}_${os}.sh 20"
sh "./Installation/Pipeline/mac/build_${edition}_${os}.sh 16"
}
else if (os == 'windows') {
powershell ". .\\Installation\\Pipeline\\windows\\build_${edition}_${os}.ps1"
@ -895,6 +924,10 @@ def buildStepCheck(edition, os, full) {
return false
}
if (restrictions && !restrictions["build-${edition}-${os}"]) {
return false
}
return true
}