I have trimmed down the script, to keep it to bare minimum. 



On Friday, September 23, 2016 at 12:30:52 PM UTC-5, ok999 wrote:
>
> This is a test jenkins workflow script that i was testing and i am getting 
> crazy as to why the catch is being executed even when the try section is a 
> success. Any pointers will be appreciated. 
>
>
>
> //def notify
>
> node('Linux'){
>
>     try {
>       stage name: 'Init'
>         //def mvnHome = tool 'M3'
>         def mvnHome = tool 'Linux-Maven'
>         env.PATH = "${mvnHome}/bin:${env.PATH}"
>
>      stage name: 'Code Checkout'
>         checkout([$class: 'GitSCM', branches: [[name: '*/master']], 
> doGenerateSubmoduleConfigurations: false, extensions: [[$class: 
> 'CloneOption', noTags: false, reference: '', shallow: true]], gitTool: 
> 'Linux_Git', submoduleCfg: [], userRemoteConfigs: [[credentialsId: 
> '8c38cbe8-f4e2-4150-918a-0264a28cff73', url: 'g...@github.com:repo1']]])
>         checkout changelog: false, poll: false, scm: [$class: 'GitSCM', 
> branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, 
> extensions: [[$class: 'CloneOption', noTags: true, reference: '', shallow: 
> true], [$class: 'RelativeTargetDirectory', relativeTargetDir: 
> 'jenks-scripts']], gitTool: 'Linux_Git', submoduleCfg: [], 
> userRemoteConfigs: [[credentialsId: '8c38cbe8-f4e2-4150-918a-0264a28cff73', 
> url: 'g...@github.com:repo2.git']]]
>
>   //  stage name: 'Load groovy scripts'
>     //    notify = load 'jenks-scripts/notify.groovy'
>
>      stage name: 'Code Build'
>         //bat "${mvnHome}/bin/mvn -B clean deploy"
>         sh 'mvn -B clean deploy'
>       //  sh 'echo $?'
>
>
>     }
>
>     catch(err){
>      stage name: 'Send Notification'
>         currentBuild.result = 'FAILURE'
>         //throw err;
>         //notify.notifyFailed()
>     }
> }
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b1c15358-3147-4672-a06d-da14b11cb560%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to