1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

Overwrite jenkins params from git commit messages.

[ci TESTOPTIONS="-test.run ^TestSimpleSingle$"]
This commit is contained in:
Ewout Prangsma 2018-03-27 08:53:49 +02:00
parent 531ce8a994
commit d8dc24efa4
No known key found for this signature in database
GPG key ID: 4DBAD380D93D0698

View file

@ -19,6 +19,19 @@ def notifySlack(String buildStatus = 'STARTED') {
slackSend(color: color, channel: '#status-k8s', message: msg)
}
def fetchParamsFromGitLog() {
def options = sh(returnStdout: true, script: "git log --reverse master..HEAD | grep -o '\[ci[^\[]*\]' | sed -E 's/\[ci (.*)\]/\1/'").trim().split("\n")
for (opt in options) {
def idx = opt.indexOf('=');
if (idx > 0) {
def key = opt.subString(0, idx);
def value = opt.subString(idx+1);
params[key] = value;
println("Overwriting params.${key} with ${value}");
}
}
}
def kubeConfigRoot = "/home/jenkins/.kube"
def buildTestSteps(String kubeConfigRoot, String kubeconfig) {
@ -32,6 +45,7 @@ def buildTestSteps(String kubeConfigRoot, String kubeconfig) {
"IMAGETAG=jenkins-test",
"KUBECONFIG=${kubeConfigRoot}/${kubeconfig}",
"LONG=${params.LONG ? 1 : 0}",
"TESTOPTIONS=${params.TESTOPTIONS}",
]) {
sh "make run-tests"
}
@ -68,6 +82,13 @@ pipeline {
string(name: 'ENTERPRISEIMAGE', defaultValue: '', description: 'ENTERPRISEIMAGE sets the docker image used for enterprise tests)', )
}
stages {
stage("Prepare") {
steps {
script {
fetchParamsFromGitLog()
}
}
}
stage('Build') {
steps {
timestamps {
@ -76,6 +97,7 @@ pipeline {
"DOCKERNAMESPACE=${params.DOCKERNAMESPACE}",
"IMAGETAG=jenkins-test",
"LONG=${params.LONG ? 1 : 0}",
"TESTOPTIONS=${params.TESTOPTIONS}",
]) {
sh "make"
sh "make run-unit-tests"