From c0164b40f06aa44104874099651bce75e27f02d2 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Thu, 28 Apr 2022 15:22:49 +0200 Subject: [PATCH] remove multiple steps from stage --- Jenkinsfile | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9fe7736..f55b582 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -66,32 +66,27 @@ pipeline { } } steps { - echo 'Cron build enabled. Deploy from system ongoing' - script { - // parse the report and extract the data - def components = parseCSVList(deployList) - assert 0 < components.size(): "No component found" - for (component in components) { - println "Deploy on going of component: $component" - } - - } - } - steps { + echo 'Cron build enabled. Deploy from system ongoing' + script { + // parse the report and extract the data + def components = parseCSVList(deployList) + assert 0 < components.size(): "No component found" + for (component in components) { + println "Deploy on going of component: $component" + } + } catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh "exit 1" } - } - steps { - sh ''' - echo "cleanup $DEPLOY_FILE"; - if [ -f ${DEPLOY_BACKUP} ]; then - echo "backup found: ${DEPLOY_BACKUP} going to replace it"; - rm ${DEPLOY_BACKUP}; - mv ${DEPLOY_FILE} ${DEPLOY_BACKUP}; - touch ${DEPLOY_FILE}; - fi - ''' + sh ''' + echo "cleanup $DEPLOY_FILE"; + if [ -f ${DEPLOY_BACKUP} ]; then + echo "backup found: ${DEPLOY_BACKUP} going to replace it"; + rm ${DEPLOY_BACKUP}; + mv ${DEPLOY_FILE} ${DEPLOY_BACKUP}; + touch ${DEPLOY_FILE}; + fi + ''' } } stage('Nothing to do by System ') {