[JIRA] (JENKINS-54602) Pipeline post action should support conditions

2 views
Skip to first unread message

kamil.grabowski@gmail.com (JIRA)

unread,
Nov 13, 2018, 6:17:02 AM11/13/18
to jenkinsc...@googlegroups.com
Kamil Grabowski created an issue
 
Jenkins / Improvement JENKINS-54602
Pipeline post action should support conditions
Issue Type: Improvement Improvement
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2018-11-13 11:16
Environment: Jenkins ver. 2.138.2
Pipeline: Model API 1.3.2
Priority: Minor Minor
Reporter: Kamil Grabowski

Hello,

Would be nice to add a when conditions to pipeline post actions. Here is an example:

pipeline {
    agent any;
    stages { ... }
    // run only for master branch
    post {
        when { branch 'master' }
        failure {
            // send slack notification about failure build
        }
    }
    // run without any additional conditions (it works now)
    post {
        success { ... }
        cleanup { ... }
    }
}

I don't have a good idea how to implement this without breaking-changes. In this example
there is an idea that we can add multiple pipeline post blocks (one for every when condition)

Motivation:
I would like to send notification about failed builds, but only for releases braches. We don't want to receive notifications about failed pull requests builds.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

andrew.bayer@gmail.com (JIRA)

unread,
Nov 13, 2018, 3:31:02 PM11/13/18
to jenkinsc...@googlegroups.com
Andrew Bayer resolved as Duplicate
Change By: Andrew Bayer
Status: Open Resolved
Resolution: Duplicate

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:25:25 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Duplicate
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages