add status code return

This commit is contained in:
Roberto Cirillo 2022-05-09 16:06:17 +02:00
parent 5ced6872da
commit ec2f653223
1 changed files with 5 additions and 5 deletions

10
Jenkinsfile vendored
View File

@ -131,7 +131,8 @@ pipeline {
steps {
echo "Cron build disabled. New deploy of ${params.TRIGGER_JOB} - ${params.TRIGGER_VERSION} ongoing"
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
deploy("${params.TRIGGER_JOB}", "${params.TRIGGER_VERSION}", "${params.TRIGGER_HOST}")
checkup("${params.TRIGGER_JOB}", "${params.TRIGGER_VERSION}", "${params.TRIGGER_HOST}");
deploy("${params.TRIGGER_JOB}", "${params.TRIGGER_VERSION}", "${params.TRIGGER_HOST}");
}
}
@ -212,13 +213,12 @@ def appendFooter( def File) {
def deploy(String service, String version, String host){
def now = new Date();
println("Going to deploy the service "+service+" with version: "+version+" on target: "+host);
sh("""
cd /var/lib/jenkins/ansible-repos/ansible-playbooks/d4science-ghn-cluster/;
def statusCode = sh( script: "cd /var/lib/jenkins/ansible-repos/ansible-playbooks/d4science-ghn-cluster/;
git pull;
cd CD;
echo '\033[34mStarting\033[0m \033[33mAnsible\033[0m \033[35mWorld\033[0m'
echo \'\\033[34mStarting\\033[0m \\033[33mAnsible\\033[0m \\033[35mWorld\\033[0m\'
./deployService.sh $service $version $host
""")
", returnStdout: true):
}
def checkup(String service, String version, String host){