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
Claim build failures Requires the Jenkins Claim Plugin.
Example:
publishers:
- claim-build
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
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
subject: Subject for Build ${BUILD_NUMBER}
body: The build has finished
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'
Update relevant JIRA issues Requires the Jenkins JIRA Plugin
Example:
publishers:
- jira
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
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/**'
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
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'
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