You can use the *post{}* block within a stage in the declarative pipeline:  



stage('Run Integration Tests') {
           steps {
               timeout(time: 30, unit: 'MINUTES') {
                   retry(1) {
                       build job: 'my-integration-test'
                   }
               }
            }
            post {
                always {

                }
                changed {

                }
                success {

                }
                failure {

                }
                unstable {

                }
            }
       }





On Wednesday, September 20, 2017 at 2:50:21 PM UTC-6, Kai wrote:
>
> Hi,
>
> I have a pipeline with multiple stages and for my integration test stage, 
> I trigger my integration test. I wanted to setup some post-step based 
> logic where if the test job passes, it does some action and if the test job 
> fails it performs a different action (e.g. send email) .
>
> stage('Run Integration Tests') {
>             steps {
>                 timeout(time: 30, unit: 'MINUTES') {
>                     retry(1) {
>                         build job: 'my-integration-test'
>                     }
>                 } 
>             }
>         }
> Enter code here...
>
> Is it possible to accomplish this kind of setup ?
>
> Thanks
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f916cd21-a7c3-417a-bd9e-d8632dcc34a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to