fix print

This commit is contained in:
Roberto Cirillo 2022-10-04 12:31:28 +02:00
parent 922ffd83be
commit 368b9609a2
1 changed files with 3 additions and 54 deletions

55
Jenkinsfile vendored
View File

@ -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."
}
}
@ -311,43 +300,3 @@ def cleanup(def DEPLOY_FILE, def BACKUP_FILE){
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
'''
}