From f03fd75af7ac34b8ac190c7fee03fd1bfb412898 Mon Sep 17 00:00:00 2001 From: Dominik Chilla Date: Sun, 12 Jul 2020 00:13:11 +0200 Subject: [PATCH] cosmetics --- Jenkinsfile | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9540b55..13eaa6a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,27 +3,37 @@ pipeline { agent any + environment { + PROD_TAG = '11_abcdef9' + deployment_name = 'some_random_deployment' + } + stages { stage('Approve'){ steps { script { def userInput - //catchError(buildResult: 'SUCCESS', stageResult: 'ABORTED') { - try { - timeout(time: 15, unit: 'SECONDS') { - userInput = input(id: 'Proceed1', message: 'Was this successful?', parameters: [[ - $class: 'BooleanParameterDefinition', - defaultValue: true, - description: '', - name: 'Please confirm you agree with this' - ]]) - } - } catch(org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) { - error "Caught ${e.toString()}" - } catch(err) { // input false - echo "This job has been aborted" + try { + timeout(time: 15, unit: 'SECONDS') { + userInput = input( + id: 'approve_deploy_at_prod', + ok: 'Yepp, go on!', + message: "Do you want to deploy version ${PROD_TAG}@${env.deployment_name} in PROD?"/*, + parameters: [ + [ + $class: 'BooleanParameterDefinition', + defaultValue: true, + description: '', + name: 'Please confirm you agree with this' + ] + ]*/ + ) } - //} + } catch(org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) { + error "Caught ${e.toString()}" + } catch(err) { // input false + echo "This job has been aborted" + } if (userInput == true) { // do something echo "this was successful" @@ -35,6 +45,13 @@ pipeline { } } } + stage('deploy@PROD'){ + steps{ + script{ + echo "deploy@PROD..." + } + } + } } post { always {