Flexible Publish Plugin

Skip to end of metadata
Go to start of metadata

Plugin Information

Plugin ID flexible-publish Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
Dependencies
0.12
Sep 14, 2013
1.425
run-condition (version:0.7)
token-macro (version:1.5.1)
Source Code
Issue Tracking
Maintainer(s)
GitHub
Open Issues
Bap (id: bap)
IKEDA Yasuyuki (id: ikedam)
Usage Installations 2013-Apr 1336
2013-May 1435
2013-Jun 1526
2013-Jul 1598
2013-Aug 1678
2013-Sep 1774
2013-Oct 1834
2013-Nov 1921
2013-Dec 1980
2014-Jan 2179
2014-Feb 2233
2014-Mar 2349

Features
Install
Import existing publishers
Caveats
Used with multi-configuration projects
Change log

Features

Always use Always
If you always add your Post-build Actions to Flexible publish, then not only will you be able to change the execution order afterwards, but you will have the ability to temporarily disable a publisher without losing the publishers' configuration.
You can just switch between the Always and the Never run conditions.

Install

This plugin can be installed from the Update Center (Manage Jenkins > Manage Plugins) under "Other Post-Build Actions".

To install manually, download the latest plugin from http://mirrors.jenkins-ci.org/plugins/flexible-publish/ and use the Upload Plugin option in the Advanced tab of the Plugin Manager.
If you do install manually, you will need to also install the Run Condition Plugin from http://mirrors.jenkins-ci.org/plugins/run-condition/ and the Token Macro Plugin from http://mirrors.jenkins-ci.org/plugins/token-macro/.

Import existing publishers

In Manage Jenkins/ Script console, copy the following to see which publishers can be moved (for a job named 'My Job')

import static org.jenkins_ci.plugins.flexible_publish.JobUpdater.*

def job = hudson.model.Hudson.instance.getItem('My Job')
list job

Or, if you like doing it the hard way ...

org.jenkins_ci.plugins.flexible_publish.JobUpdater.list(hudson.model.Hudson.instance.getItem('My Job'))

You should see a list something like this

Result: Enabled publishers that can be moved:
	[Publish Checkstyle analysis results]
	[Publish FindBugs analysis results]
	[Publish PMD analysis results]
	[Publish duplicate code analysis results]
	[Scan for compiler warnings]
	[Scan workspace for open tasks]
	[Publish combined analysis results]
	[Archive the artifacts]
	[Publish JUnit test result report]
	[Publish Javadoc]
	[Record fingerprints of files to track usage]
	[Git Publisher]
	[Send build artifacts over FTP]
	[Send build artifacts over SSH]
	[Send build artifacts to a windows share]

Enabled publishers that cannot be moved:
	[Aggregate downstream test results]
	[Build other projects]
	[Record Emma coverage report]
	[Report Violations]
	[E-mail Notification]

You can move a publisher into Flexible publish

import static org.jenkins_ci.plugins.flexible_publish.JobUpdater.*

def job = hudson.model.Hudson.instance.getItem('My Job')
movePublisher job, 'Publish JUnit test result report'

After moving one or more publishers, go to the configure page, check everything looks ok, then save the configuration.

If you like to live on the edge, and would like to move all of the publishers in one go, then ...

import static org.jenkins_ci.plugins.flexible_publish.JobUpdater.*

def job = hudson.model.Hudson.instance.getItem('My Job')
moveAllPublishers job

Caveats

Grain of salt
Almost every publisher I have tried works without issue.

The exceptions are
Record fingerprints of files to track usage/Fingerprint all archived artifacts. If you Archive the artifacts from within the Flexible publisher, then the files you want to fingerprint will need to be listed explicitly as the fingerprinter will not find the archiver where it is expecting it!

  • Some publishers may not be prepared to run more than once during a build
  • Some publishers may expect to always run before or always run after another publisher
  • Not all publishers are available for inclusion in the Flexible publish action. Dev note:- Specifically, the publisher must use a DataBoundConstructor to be available.
  • Some publishers state that they should only run after the build has been finalized - when the build status is known, and cannot be modified. The Flexible publish action does not enforce this restriction.

Used with multi-configuration projects

When you use Flexible Publish Plugin with multi-configuration projects (aka. matrix projects), you should know followings:

Generally, publishers run in two phase for multi-configuration projects.

  1. Run for each combination of axes. It works just like in Free Style Projects.
  2. Run for whole the multi-configuration project. This is what is called aggregation.

For example, "Publish JUnit test result report" works:

  1. see test results in each combination of axes
  2. sum up the results of all of the combinations.

You can specify conditions both for each combination and the aggregation.
If you want to separate condition for them, check "Condition for Matrix Aggregation" (This appears only in multi-configuration projects).

This is especially useful for the case you want control the execution of the publisher depends on combination of axes.
Be careful to specify the condition, for inconsistent execution causes the build fails.

Issues

JIRA Issues (3 issues)
Type Key Summary
Improvement JENKINS-22187 Add support of multiple actions inside the condition
New Feature JENKINS-22133 Add "Run on configuration" option for matrix projects
Bug JENKINS-20632 Conditionally execute Coverity plugin fails during publish.

Change log

0.12 (14/09/2013)

0.11 (07/09/2013)

0.10 (03/07/2012)

  • Fixed JENKINS-13795 NPE when configuring Flexible publish in a new job

0.9 (14/02/2012)

0.8 (17/01/2012)

  • Exclude "Trigger parametrized build on other projects" JENKINS-12418

0.7 (14/11/2011)

  • Mark the build as a failure if an action would have stopped the build

0.6 (12/11/2011)

  • Add some utility methods to allow publishers to be moved into Flexible publish from the script console
  • Don't allow "Build other projects" in the Flexible publish - it does not work here
  • Do not allow the actions to prevent other publishers from running (unless they throw an exception)

0.5 (11/11/2011)

  • Changed the EP interface

0.4 (11/11/2011)

  • Add extension to enable the list of publishers to be modified

0.3 (10/11/2011)

  • Updated a help file

0.2 (09/11/2011)

  • Enable the user to choose what will happen if the evaluation of a condition fails

0.1 (07/11/2011)

  • Initial release
Questions, Comments, Bugs and Feature Requests
Please post questions or comments about this plugin to the Jenkins User mailing list.
To report a bug or request an enhancement to this plugin please create a ticket in JIRA.

Labels

Edit
plugin-post-build plugin-post-build Delete
runcondition-consumer runcondition-consumer Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Add Comment