cosmetics
This commit is contained in:
parent
e1b09d634b
commit
f03fd75af7
47
Jenkinsfile
vendored
47
Jenkinsfile
vendored
@ -3,27 +3,37 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
environment {
|
||||||
|
PROD_TAG = '11_abcdef9'
|
||||||
|
deployment_name = 'some_random_deployment'
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Approve'){
|
stage('Approve'){
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def userInput
|
def userInput
|
||||||
//catchError(buildResult: 'SUCCESS', stageResult: 'ABORTED') {
|
try {
|
||||||
try {
|
timeout(time: 15, unit: 'SECONDS') {
|
||||||
timeout(time: 15, unit: 'SECONDS') {
|
userInput = input(
|
||||||
userInput = input(id: 'Proceed1', message: 'Was this successful?', parameters: [[
|
id: 'approve_deploy_at_prod',
|
||||||
$class: 'BooleanParameterDefinition',
|
ok: 'Yepp, go on!',
|
||||||
defaultValue: true,
|
message: "Do you want to deploy version ${PROD_TAG}@${env.deployment_name} in PROD?"/*,
|
||||||
description: '',
|
parameters: [
|
||||||
name: 'Please confirm you agree with this'
|
[
|
||||||
]])
|
$class: 'BooleanParameterDefinition',
|
||||||
}
|
defaultValue: true,
|
||||||
} catch(org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {
|
description: '',
|
||||||
error "Caught ${e.toString()}"
|
name: 'Please confirm you agree with this'
|
||||||
} catch(err) { // input false
|
]
|
||||||
echo "This job has been aborted"
|
]*/
|
||||||
|
)
|
||||||
}
|
}
|
||||||
//}
|
} 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) {
|
if (userInput == true) {
|
||||||
// do something
|
// do something
|
||||||
echo "this was successful"
|
echo "this was successful"
|
||||||
@ -35,6 +45,13 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stage('deploy@PROD'){
|
||||||
|
steps{
|
||||||
|
script{
|
||||||
|
echo "deploy@PROD..."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user