Publishers define actions that the Jenkins job should perform after the build is complete.
Macro: | publisher |
---|---|
Entry Point: | jenkins_jobs.publishers |
Example:
job:
name: test_job
publishers:
- scp:
site: 'example.com'
source: 'doc/build/html/**/*'
target_path: 'project'
Aggregate downstream test results
Parameters: | include-failed-builds (bool) – whether to include failed builds |
---|
Example:
publishers:
- aggregate-tests:
include-failed-builds: true
Archive build artifacts
Parameters: |
|
---|
Example:
publishers:
- archive:
artifacts: '*.tar.gz'
Publish trend reports with Checkstyle. Requires the Checkstyle Plugin.
The checkstyle component accepts a dictionary with the following values:
Parameters: |
|
---|
Example:
publishers:
- checkstyle:
pattern: '**/checkstyle-result.xml'
healthy: 0
unHealthy: 100
healthThreshold: 'high'
thresholds:
unstable:
totalHigh: 10
failed:
totalHigh: 1
Upload files via CIFS. Requires the Jenkins Publish over CIFS Plugin.
Parameters: |
|
---|
Example:
publishers:
- cifs:
site: 'cifs.share'
target: 'dest/dir'
source: 'base/source/dir/**'
remove-prefix: 'base/source/dir'
excludes: '**/*.excludedfiletype'
Claim build failures Requires the Jenkins Claim Plugin.
Example:
publishers:
- claim-build
Generate a cobertura coverage report. Requires the Jenkins Cobertura Coverage Plugin.
Parameters: |
|
---|
Example:
publishers:
- cobertura:
report-file: "/reports/cobertura/coverage.xml"
only-stable: "true"
fail-no-reports: "true"
fail-unhealthy: "true"
fail-unstable: "true"
health-auto-update: "true"
stability-auto-update: "true"
zoom-coverage-chart: "true"
source-encoding: "Big5"
targets:
- files:
healthy: 10
unhealthy: 20
failing: 30
- method:
healthy: 50
unhealthy: 40
failing: 30
Copy files to master from slave Requires the Jenkins Copy To Slave Plugin.
Parameters: |
|
---|
Example:
publishers:
- copy-to-master:
includes:
- file1
- file2*.txt
excludes:
- file2bad.txt
WARNING: The coverage function is deprecated. Instead, use the cobertura function to generate a cobertura coverage report. Requires the Jenkins Cobertura Coverage Plugin.
Example:
publishers:
- coverage
Cppcheck result publisher Requires the Jenkins Cppcheck Plugin.
Parameters: | pattern (str) – file pattern for cppcheck xml report |
---|
for more optional parameters see the example
Example:
publishers:
- cppcheck:
pattern: "**/cppcheck.xml"
# the rest is optional
# build status (new) error count thresholds
thresholds:
unstable: 5
new-unstable: 5
failure: 7
new-failure: 3
# severities which count towards the threshold, default all true
severity:
error: true
warning: true
information: false
graph:
xysize: [500, 200]
# which errors to display, default only sum
display:
sum: false
error: true
Email notifications on build failure.
Parameters: |
|
---|
Example:
publishers:
- email:
recipients: breakage@example.com
Extend Jenkin’s built in email notification Requires the Jenkins Email-ext Plugin.
Parameters: |
|
---|
Example:
publishers:
- email-ext:
recipients: foo@example.com, bar@example.com
reply-to: foo@example.com
subject: Subject for Build ${BUILD_NUMBER}
body: The build has finished
attach-build-log: false
unstable: true
first-failure: true
not-built: true
aborted: true
regression: true
failure: true
improvement: true
still-failing: true
success: true
fixed: true
still-unstable: true
pre-build: true
Fingerprint files to track them across builds
Parameters: |
|
---|
Example:
publishers:
- fingerprint:
files: builddir/test*.xml
record-artifacts: false
Upload files via FTP. Requires the Jenkins Publish over FTP Plugin.
Parameters: |
|
---|
Example:
publishers:
- ftp:
site: 'ftp.example.com'
target: 'dest/dir'
source: 'base/source/dir/**'
remove-prefix: 'base/source/dir'
excludes: '**/*.excludedfiletype'
Execute a groovy script. Requires the Jenkins Groovy Postbuild Plugin
Parameter: | the groovy script to execute |
---|
Example:
publishers:
- groovy-postbuild: "manager.buildFailure()"
Integrates Jenkins with the Jabber/XMPP instant messaging protocol Requires the Jenkins Jabber Plugin.
Parameters: |
|
---|
Example:
publishers:
- jabber:
notify-on-build-start: true
group-targets:
- "foo-room@conference-2-fooserver.foo.com"
individual-targets:
- "foo-user@conference-2-fooserver.foo.com"
strategy: all
message: summary-scm
Update relevant JIRA issues Requires the Jenkins JIRA Plugin
Example:
publishers:
- jira
Trigger a job after all the immediate downstream jobs have completed
Parameters: | projects (list) – list of projects to trigger |
---|
Example:
publishers:
- join-trigger:
projects:
- project-one
- project-two
Publish JUnit test results.
Parameters: | results (str) – results filename |
---|
Example:
publishers:
- junit:
results: nosetests.xml
Requires the Jenkins Log Parser Plugin.
Parameters: |
|
---|
parse-rules: “/path/to/parserules” unstable-on-warning: true fail-on-error: true
Deploy artifacts to Maven repository.
Parameters: |
|
---|
Example:
publishers:
- maven-deploy:
id: example
url: http://repo.example.com/maven2/
unique-version: true
deploy-unstable: false
Publish performance test results from jmeter and junit. Requires the Jenkins Performance Plugin.
Parameters: |
|
---|
Examples:
publishers:
- performance:
failed-threshold: 85
unstable-threshold: -1
report:
- jmeter: "/special/file.jtl"
- junit: "/special/file.xml"
publishers:
- performance:
failed-threshold: 85
unstable-threshold: -1
report:
- jmeter
- junit
publishers:
- performance:
failed-threshold: 85
unstable-threshold: -1
report:
- jmeter: "/special/file.jtl"
- junit: "/special/file.xml"
- jmeter
- junit
Specify a downstream project in a pipeline. Requires the Jenkins Build Pipeline Plugin.
Parameter: | the name of the downstream project |
---|
Example:
publishers:
- pipleline: deploy
You can build pipeline jobs that are re-usable in different pipelines by using a Job Template to define the pipeline jobs, and variable substitution to specify the name of the downstream job in the pipeline. Job-specific substitutions are useful here (see Project).
See ‘samples/pipeline.yaml’ for an example pipeline implementation.
Upload files via SCP Requires the Jenkins SCP Plugin.
Parameters: |
|
---|
Example:
publishers:
- scp:
site: 'example.com'
target: 'dest/dir'
source: 'base/source/dir/**'
Sonar plugin support. Requires the Jenkins Sonar Plugin.
Parameters: |
|
---|
This publisher supports the post-build action exposed by the Jenkins Sonar Plugin, which is triggering a Sonar Analysis with Maven.
Example:
publishers:
- sonar:
jdk: MyJdk
branch: myBranch
language: java
maven-opts: -DskipTests
additional-properties: -DsonarHostURL=http://example.com/
skip-global-triggers:
skip-when-scm-change: true
skip-when-upstream-build: true
skip-when-envvar-defined: SKIP_SONAR
Upload files via SCP. Requires the Jenkins Publish over SSH Plugin.
Parameters: |
|
---|
Example:
publishers:
- ssh:
site: 'server.example.com'
target: 'dest/dir'
source: 'base/source/dir/**'
remove-prefix: 'base/source/dir'
excludes: '**/*.excludedfiletype'
Trigger non-parametrised builds of other jobs.
Parameters: |
|
---|
Example:
publishers:
- trigger:
project: other_job
Trigger parameterized builds of other jobs. Requires the Jenkins Parameterized Trigger Plugin.
Parameters: |
|
---|
Example:
publishers:
- trigger-parameterized-builds:
- project: other_job, foo, bar
predefined-parameters: foo=bar
- project: other_job1, other_job2
predefined-parameters: BUILD_NUM=${BUILD_NUMBER}
property-file: version.prop
- project: yet_another_job
predefined-parameters: foo=bar
git-revision: true
Publish code style violations. Requires the Jenkins Violations Plugin.
The violations component accepts any number of dictionaries keyed by the name of the violations system. The dictionary has the following values:
Parameters: |
|
---|
Any system without a dictionary provided will use default values.
Valid systems are:
checkstyle, codenarc, cpd, cpplint, csslint, findbugs, fxcop, gendarme, jcreport, jslint, pep8, pmd, pylint, simian, stylecop
Example:
publishers:
- violations:
pep8:
min: 0
max: 1
unstable: 1
pattern: '**/pep8.txt'
The pre-build workspace-cleanup is available as a wrapper.
Parameters: |
|
---|
Example:
publishers:
- workspace-cleanup:
include:
- "*.zip"
clean-if:
- success: true
- not-built: false
Publish tests results. Requires the Jenkins xUnit Plugin.
Parameters: |
|
---|
Each framework type can be configured using the following parameters:
Parameters: |
|
---|
Example:
publishers:
- xunit:
thresholdmode: 'percent'
thresholds:
- failed:
unstable: 0
unstablenew: 0
failure: 0
failurenew: 0
- skipped:
unstable: 0
unstablenew: 0
failure: 0
failurenew: 0
types:
- phpunit:
pattern: junit.log
- cppUnit:
pattern: cppunit.log