From ac94e042f4c9e458f9af502e26b588daf1f3b007 Mon Sep 17 00:00:00 2001 From: MovingToWeb Date: Fri, 19 Jul 2019 22:25:35 +0530 Subject: [PATCH] add input stage --- Jenkinsfile | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9a9ee52..a613902 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,18 +20,31 @@ pipeline { } } + stage ('Deploy?') { + + try { + input( + id: 'Proceed1', message: 'Proceed to Production deployment?', parameters: [ + [$class: 'BooleanParameterDefinition', defaultValue: true, description: '', name: 'Please confirm deployment'] + ]) + } + catch (Exception e) { + + } + + } stage ('Deployment Stage') { steps { - withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'PCF_LOGIN', -usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'PCF_LOGIN', + usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { -sh '/usr/local/bin/cf login -a http://api.run.pivotal.io -u $USERNAME -p $PASSWORD' - sh '/usr/local/bin/cf push' + sh '/usr/local/bin/cf login -a http://api.run.pivotal.io -u $USERNAME -p $PASSWORD' + sh '/usr/local/bin/cf push' - } + } } } }