generated from gCubeCI/Pipeline-Docker-Template
fix print
This commit is contained in:
parent
922ffd83be
commit
368b9609a2
|
@ -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
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue