add foo input parameter

feature/26875
Roberto Cirillo 2 months ago
parent 8a95929a8a
commit 693c528411

15
Jenkinsfile vendored

@ -71,6 +71,8 @@ pipeline {
TRIGGER_HOST="${params.TRIGGER_HOST}"
// enable the ContinuousDeployment if TRUE
TRIGGER_CD="${params.TRIGGER_CD}"
// generic parameter that can be passed to the ansible job
TRIGGER_FOO="${params.TRIGGER_FOO}"
// Useful to identify the remote YAML file
GCUBE_RELEASE_NUMBER = "${params.gCube_release_version}"
//Category name of the components candidates to the remote deployment
@ -100,6 +102,9 @@ pipeline {
booleanParam(name: 'TRIGGER_CD',
defaultValue: true,
description: 'Set to false to avoid current deploy')
string(name: 'TRIGGER_FOO',
defaultValue: '',
description: 'Additional parameter to pass to the ansible job. Leave blank if not used')
string(name: 'gCube_release_version',
defaultValue: '',
description: 'The number of the current gCube release. Leave blank if executed outside gCube release.')
@ -200,7 +205,7 @@ pipeline {
ansiColor('xterm') {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
checkup("${params.TRIGGER_JOB}", "${params.TRIGGER_VERSION}", "${params.TRIGGER_HOST}");
deploy("${params.TRIGGER_JOB}", "${params.TRIGGER_VERSION}", "${params.TRIGGER_HOST}");
deploy("${params.TRIGGER_JOB}", "${params.TRIGGER_VERSION}", "${params.TRIGGER_HOST}", "${params.TRIGGER_FOO}");
}
}
}
@ -240,7 +245,7 @@ pipeline {
echo '\033[31;1;4mNew deploy ongoing manually triggered\033[0m'
echo "Cron build disabled. Pipeline executed Manually. 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}");
deploy("${params.TRIGGER_JOB}", "${params.TRIGGER_VERSION}", "${params.TRIGGER_HOST}", "${params.TRIGGER_FOO}");
}
}
}
@ -337,10 +342,10 @@ def deployJobs(def serviceList){
}
//Run ansible deploy
def deploy(String service, String version, String host){
def deploy(String service, String version, String host, String foo){
def now = new Date();
println("Going to deploy the service "+service+" with version: "+version+" on target: "+host);
def statusCode = sh( script: "cd ${ANSIBLE_ROOT_FOLDER}/CD;./deployService.sh $service $version $host;", returnStdout: true);
println("Going to deploy the service "+service+" with version: "+version+" on target: "+host+" with argument: "+foo);
def statusCode = sh( script: "cd ${ANSIBLE_ROOT_FOLDER}/CD;./deployService.sh $service $version $host $foo;", returnStdout: true);
sh("""
echo " last exit code \$?";
""")

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save