ci(Jenkinsfile): Catch timeout exception (#49)
To prevent the pipeline from failing
| | |
| | | } |
| | | |
| | | 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 { |