Jaime Ramírez
2020-06-11 a654d9fad5176184b1ba1867e09ac3406eeff750
ci(Jenkinsfile): Catch timeout exception (#49)

To prevent the pipeline from failing
1 files modified
19 ■■■■ changed files
adopt-a-pup/web-app/Jenkinsfile 19 ●●●● patch | view | raw | blame | history
adopt-a-pup/web-app/Jenkinsfile
@@ -69,15 +69,28 @@
            }
            steps {
                timeout(time: 10, unit: 'MINUTES') {
                    input 'Build and deploy image to quay?'
                script {
                    env.DEPLOY = true
                    try {
                        timeout(time: 5, unit: 'MINUTES') {
                            input "Build and push image to quay?"
                        }
                    // By catching the timeout exception, we prevent the pipeline from failing
                    } catch (err) {
                        env.DEPLOY = false
                    }
                }
            }
        }
        stage('adopt-a-pup web-app: Build and push image') {
            when {
                branch 'master'
                allOf {
                    branch 'master'
                    expression {
                        env.DEPLOY == true
                    }
                }
            }
            steps {