From 368b9609a22bb842dfde9e17f425507c63b47bd6 Mon Sep 17 00:00:00 2001 From: "roberto.cirillo" Date: Tue, 4 Oct 2022 12:31:28 +0200 Subject: [PATCH] fix print --- Jenkinsfile | 57 +++-------------------------------------------------- 1 file changed, 3 insertions(+), 54 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 46e3980..d1b9e4a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,8 +14,6 @@ import jenkins.model.Jenkins; // related jenkins job: https://jenkins.d4science.org/job/gCubeDeployer/ def agent_root_folder = '/var/lib/jenkins' -//def agent_deploy_filename = 'deploy.${env.BUILD_NUMBER}.csv' -//def agent_deploy_backup_filename = 'deploy.${env.BUILD_NUMBER}.bck' def deployList def backupList @@ -24,15 +22,6 @@ if (params.deployFile) { deployList = params.deployFile } -//locate the targetHost file -//String targetHostURL = "https://code-repo.d4science.org/gCubeCI/gCubeDeployer/raw/branch/master/open/gcube-${gCube_release_version}.yaml" -//if (verbose) -// println "Querying ${targetHostURL}" -//load the release file -//def text = targetHostURL.toURL().getText() - - - pipeline { agent { label 'ansible' @@ -121,7 +110,7 @@ pipeline { println("Processing record: "+record) if(!serviceList.contains(record.get(0))){ stage(record.get(0)){ - println "Deploy on going of component: record.get(0)" + println "Deploy on going of component: ${record.get(0)}" catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') { checkup(record.get(0), record.get(1), record.get(2)); deploy(record.get(0), record.get(1), record.get(2)); @@ -129,7 +118,7 @@ pipeline { } serviceList << record.get(0) }else{ - echo "${record.get(0)} already deployed" + echo "${record.get(0)} already deployed. Deployment skipped." } } @@ -310,44 +299,4 @@ def cleanup(def DEPLOY_FILE, def BACKUP_FILE){ echo "deploy file empty" fi ''' -} - -//clean and update the local deploy file -def clean(files){ - sh ''' - echo "parsing ${files}"; - for file in `ls $files`; do - echo "cleaning $file"; - if [ -f $file ]; then - rm $file; - else - echo "file not exist" - fi - done - ''' -} - - -//experimental test -def getComponentsFromCSVDir4(def dirPath){ - sh ''' - echo "parsing $dirPath"; - for entry in `ls $dirPath`; do - INPUT=$entry - OLDIFS=$IFS - IFS=',' - [ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; } - while read artifactid version host - do - echo "Component name : $artifactid" - echo "Component version : $version" - echo "Target host : $host" - done < $INPUT - IFS=$OLDIFS - done - ''' -} - - - - +} \ No newline at end of file