add check on snapshot; add host field in pending job stage

This commit is contained in:
Roberto Cirillo 2022-05-10 14:16:54 +02:00
parent 28f63c3eb9
commit 10ec47cbe5
1 changed files with 9 additions and 4 deletions

13
Jenkinsfile vendored
View File

@ -78,8 +78,8 @@ pipeline {
stage(component){ stage(component){
println "Deploy on going of component: $component" println "Deploy on going of component: $component"
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
// calling the ansible dispatcher here checkup("${component.name}", "${component.version}", "${component.host}");
sh "exit 0" deploy("${component.name}", "${component.version}", "${component.host}");
} }
} }
} }
@ -116,7 +116,7 @@ pipeline {
if grep -q \"\${TRIGGER_JOB}\" \${DEPLOY_FILE}; then if grep -q \"\${TRIGGER_JOB}\" \${DEPLOY_FILE}; then
echo "component ${TRIGGER_JOB} already added. Nothing to add." echo "component ${TRIGGER_JOB} already added. Nothing to add."
else else
echo "${TRIGGER_JOB},${TRIGGER_VERSION}" >> ${DEPLOY_FILE} echo "${TRIGGER_JOB},${TRIGGER_VERSION},${}" >> ${DEPLOY_FILE}
fi fi
''' '''
} }
@ -127,6 +127,10 @@ pipeline {
expression { expression {
env.TRIGGER_CD.toBoolean() env.TRIGGER_CD.toBoolean()
} }
expression {
return env.TRIGGER_VERSION.contains("SNAPSHOT")
}
anyOf{ anyOf{
triggeredBy 'BuildUpstreamCause' triggeredBy 'BuildUpstreamCause'
triggeredBy 'UpstreamCause' triggeredBy 'UpstreamCause'
@ -184,7 +188,8 @@ def parseCSVList(def deployList) {
def fields = line.split(',') def fields = line.split(',')
components.add([ components.add([
name : fields[0], name : fields[0],
version : fields[1] version : fields[1],
host : fields[2]
] ]
) )
} }