From 10ec47cbe544bdb2f964227be565cf1f322aea2f Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Tue, 10 May 2022 14:16:54 +0200 Subject: [PATCH] add check on snapshot; add host field in pending job stage --- Jenkinsfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 69751af..854575d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -78,8 +78,8 @@ pipeline { stage(component){ println "Deploy on going of component: $component" catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { - // calling the ansible dispatcher here - sh "exit 0" + checkup("${component.name}", "${component.version}", "${component.host}"); + deploy("${component.name}", "${component.version}", "${component.host}"); } } } @@ -116,7 +116,7 @@ pipeline { if grep -q \"\${TRIGGER_JOB}\" \${DEPLOY_FILE}; then echo "component ${TRIGGER_JOB} already added. Nothing to add." else - echo "${TRIGGER_JOB},${TRIGGER_VERSION}" >> ${DEPLOY_FILE} + echo "${TRIGGER_JOB},${TRIGGER_VERSION},${}" >> ${DEPLOY_FILE} fi ''' } @@ -127,6 +127,10 @@ pipeline { expression { env.TRIGGER_CD.toBoolean() } + expression { + return env.TRIGGER_VERSION.contains("SNAPSHOT") + } + anyOf{ triggeredBy 'BuildUpstreamCause' triggeredBy 'UpstreamCause' @@ -184,7 +188,8 @@ def parseCSVList(def deployList) { def fields = line.split(',') components.add([ name : fields[0], - version : fields[1] + version : fields[1], + host : fields[2] ] ) }