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

Scoping myparams

This commit is contained in:
Ewout Prangsma 2018-03-27 09:46:29 +02:00
parent 8244fae064
commit c0ac2339db
No known key found for this signature in database
GPG key ID: 4DBAD380D93D0698

View file

@ -19,9 +19,8 @@ def notifySlack(String buildStatus = 'STARTED') {
slackSend(color: color, channel: '#status-k8s', message: msg)
}
def myParams = [:];
def fetchParamsFromGitLog() {
def myParams = [:];
// Copy configured params
for (entry in params) {
println("Fetching entry from params: ${entry}");
@ -44,11 +43,12 @@ def fetchParamsFromGitLog() {
println("Overwriting myParams.${key} with ${value}");
}
}
return myParams;
}
def kubeConfigRoot = "/home/jenkins/.kube"
def buildTestSteps(String kubeConfigRoot, String kubeconfig) {
def buildTestSteps(Map myParams, String kubeConfigRoot, String kubeconfig) {
return {
timestamps {
withCredentials([string(credentialsId: 'ENTERPRISEIMAGE', variable: 'DEFAULTENTERPRISEIMAGE')]) {
@ -68,7 +68,7 @@ def buildTestSteps(String kubeConfigRoot, String kubeconfig) {
}
}
def buildCleanupSteps(String kubeConfigRoot, String kubeconfig) {
def buildCleanupSteps(Map myParams, String kubeConfigRoot, String kubeconfig) {
return {
timestamps {
withEnv([
@ -95,11 +95,12 @@ pipeline {
string(name: 'TESTNAMESPACE', defaultValue: 'jenkins', description: 'TESTNAMESPACE sets the kubernetes namespace to ru tests in (this must be short!!)', )
string(name: 'ENTERPRISEIMAGE', defaultValue: '', description: 'ENTERPRISEIMAGE sets the docker image used for enterprise tests)', )
}
def myParams;
stages {
stage("Prepare") {
steps {
script {
fetchParamsFromGitLog()
myParams = fetchParamsFromGitLog();
}
}
}
@ -126,7 +127,7 @@ pipeline {
def configs = "${myParams['KUBECONFIGS']}".split(",")
def testTasks = [:]
for (kubeconfig in configs) {
testTasks["${kubeconfig}"] = buildTestSteps(kubeConfigRoot, kubeconfig)
testTasks["${kubeconfig}"] = buildTestSteps(myParams, kubeConfigRoot, kubeconfig)
}
parallel testTasks
}
@ -140,7 +141,7 @@ pipeline {
def configs = "${myParams['KUBECONFIGS']}".split(",")
def cleanupTasks = [:]
for (kubeconfig in configs) {
cleanupTasks["${kubeconfig}"] = buildCleanupSteps(kubeConfigRoot, kubeconfig)
cleanupTasks["${kubeconfig}"] = buildCleanupSteps(myParams, kubeConfigRoot, kubeconfig)
}
parallel cleanupTasks
}