[JIRA] (JENKINS-57600) Allow post steps in the declarative pipeline to be defined as a group

6 views
Skip to first unread message

costincaraivan@gmail.com (JIRA)

unread,
May 22, 2019, 6:36:02 AM5/22/19
to jenkinsc...@googlegroups.com
Costin Caraivan created an issue
 
Jenkins / Improvement JENKINS-57600
Allow post steps in the declarative pipeline to be defined as a group
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: pipeline
Created: 2019-05-22 10:35
Environment: Jenkins 2.150.2
Priority: Major Major
Reporter: Costin Caraivan

Even when using functions to reduce duplication, our pipelines are littered with stuff like this:

post {
	always {
		collectJunitResults()
		sendBitbucketNofication(currentBuild.currentResult)
	}
	changed {
		sendEmailNofication()
	}
	unstable {
		sendEmailNofication()
	}
	failure {
		sendEmailNofication()
	}
	aborted {
		sendEmailNofication()
	}
}

It would be much, much nicer and maintainable if the identical sections could be collapsed into something like:

changed, unstable, failure, aborted { 
      sendEmailNofication()
}
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

costincaraivan@gmail.com (JIRA)

unread,
May 22, 2019, 6:37:02 AM5/22/19
to jenkinsc...@googlegroups.com
Costin Caraivan updated an issue
Change By: Costin Caraivan
Even when using functions to reduce duplication, our pipelines are littered with stuff like this:
{code:java}

post {
always {
  collectJunitResults()
  sendBitbucketNofication(currentBuild.currentResult)
}
changed {
  sendEmailNofication()
}
unstable {
  sendEmailNofication()
}
failure {
  sendEmailNofication()
}
aborted {
  sendEmailNofication()
}
}
{code}

It would be much, much nicer and maintainable if the identical sections could be collapsed into something like:
{code:java}
post {
         always {
                collectJunitResults() sendBitbucketNofication(currentBuild.currentResult)
         }
changed, unstable, failure, aborted {
      sendEmailNofication()
}

}
{code}

costincaraivan@gmail.com (JIRA)

unread,
May 22, 2019, 6:37:02 AM5/22/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages