jenkins pipeline post actions not working

297 views
Skip to first unread message

red 888

unread,
Aug 16, 2017, 1:54:27 PM8/16/17
to Jenkins Users

I setup a post action like in the examples:


pipeline {
    agent any
    stages {
        stage('Example1') {
            steps {
                bat 'return 1'                    
            }
        stage('Example2') {
            steps {
                echo 'Wont see this'
            }
        }
    }
    post { 
        always { 
            echo 'I will always say Hello'
        }
    }
}


So I do something in the first stage to make it fail. And I have a post action that always runs, but what happens when I run my pipeline in blueocean is it fails at the first stage and then just stops. Where do I see the post action that is always supposed to run??

red 888

unread,
Aug 16, 2017, 2:05:25 PM8/16/17
to Jenkins Users
So if I look at it from old jenkins view I can actually see it under the "Stage View" as "Declarative: Post Actions". But how do I view the Declarative: Post Actions in Blue Ocean?

Baptiste Mathus

unread,
Aug 17, 2017, 9:28:47 AM8/17/17
to jenkins...@googlegroups.com
Blue Ocean will show/organize things per stage. And post-actions don't generate automatically a bullet/stage, hence is not shown. But I agree it probably should. You should file an issue for it, I think the team can consider this improvement, if not already possibly filed/planned.
 
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/588af3d5-1d9b-4bde-a8fe-e9200002f944%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

red 888

unread,
Aug 17, 2017, 9:53:19 PM8/17/17
to Jenkins Users, m...@batmat.net
Actually I think understand this design decision now. its kind of useful to have a "hidden" step that cleans up or does other stuff you don't want users to see. As log as its output is visible in the old view I think thats enough for me.


On Thursday, August 17, 2017 at 9:28:47 AM UTC-4, Baptiste Mathus wrote:
Blue Ocean will show/organize things per stage. And post-actions don't generate automatically a bullet/stage, hence is not shown. But I agree it probably should. You should file an issue for it, I think the team can consider this improvement, if not already possibly filed/planned.
Le 16 août 2017 19:54, "red 888" <fakemai...@gmail.com> a écrit :

I setup a post action like in the examples:


pipeline {
    agent any
    stages {
        stage('Example1') {
            steps {
                bat 'return 1'                    
            }
        stage('Example2') {
            steps {
                echo 'Wont see this'
            }
        }
    }
    post { 
        always { 
            echo 'I will always say Hello'
        }
    }
}


So I do something in the first stage to make it fail. And I have a post action that always runs, but what happens when I run my pipeline in blueocean is it fails at the first stage and then just stops. Where do I see the post action that is always supposed to run??

--
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-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages