Wrappers can alter the way the build is run as well as the build output.
Macro: | wrapper |
---|---|
Entry Point: | jenkins_jobs.wrappers |
Automates many Android development tasks including SDK installation, build file generation, emulator creation and launch, APK (un)installation... Requires the Jenkins Android Emulator Plugin.
Parameters: |
|
---|
Example:
wrappers:
- android-emulator:
os: android-19
target-abi: x86
sd-card: 16MB
hardware-properties:
hw.accelerometer: 100
wipe: true
show-window: true
snapshot: true
delete: true
startup-delay: 10
commandline-options: "-gpu on -no-audio"
exe: emulator-arm
Translate ANSI color codes to HTML in the console log. Requires the Jenkins Ansi Color Plugin.
Parameters: | colormap (string) – (optional) color mapping to use |
---|
Examples:
wrappers:
- ansicolor
# Explicitly setting the colormap
wrappers:
- ansicolor:
colormap: vga
yaml: artifactory-generic Wrapper for non-Maven projects. Requires the Artifactory Plugin
Parameters: |
|
---|
Example:
wrappers:
- artifactory-generic:
url: http://artifactory.example.net/artifactory
name: 'test'
deploy-build-info: true
repo-key: 'release-repo'
snapshot-repo-key: 'snapshot-repo'
deploy-pattern:
- '*.zip=>results'
resolve-pattern:
- 'libs-release-local:prod/*=>prod-jars'
matrix-params:
- 'custom_prop=${PROJECT_ENV_VAR}'
env-vars-include: true
env-vars-include-patterns:
- 'PROJECT_*'
- 'ORG_*'
discard-old-builds: true
discard-build-artifacts: true
yaml: artifactory-maven Wrapper for non-Maven projects. Requires the Artifactory Plugin
Parameters: |
|
---|
Example:
wrappers:
- artifactory-maven:
url: http://artifactory.example.net/artifactory
name: 'test'
repo-key: repo
yaml: artifactory-maven-freestyle Wrapper for Free Stype projects. Requires the Artifactory plugin. Requires Artifactory Plugin
Parameters: |
|
---|
Example:
wrappers:
- artifactory-maven-freestyle:
url: http://artifactory.example.net/artifactory
name: 'test'
repo-key: repo
matrix-params:
- 'custom_prop=${PROJECT_ENV_VAR}'
deployment-include-patterns:
- '*.zip=>results'
env-vars-include: true
env-vars-include-patterns:
- 'PROJECT_*'
- 'ORG_*'
Set the name of the build Requires the Jenkins Build Name Setter Plugin.
Parameters: | name (str) – Name for the build. Typically you would use a variable from Jenkins in the name. The syntax would be ${FOO} for the FOO variable. |
---|
Example:
wrappers:
- build-name:
name: Build-${FOO}
Set environment variables to the value of the user that started the build. Requires the Jenkins Build User Vars Plugin.
Example:
wrappers:
- build-user-vars
Skip making a build for certain push. Just add [ci skip] into your commit’s message to let Jenkins know, that you do not want to perform build for the next push. Requires the Jenkins Ci Skip Plugin.
Example:
wrappers:
- ci-skip
Provide configuration files (i.e., settings.xml for maven etc.) which will be copied to the job’s workspace. Requires the Jenkins Config File Provider Plugin.
Parameters: | files (list) – List of managed config files made up of three parameters
|
---|
Example:
wrappers:
- config-file-provider:
files:
- file-id: org.jenkinsci.plugins.configfiles.custom.CustomConfig1234
- file-id: org.jenkinsci.plugins.configfiles.custom.CustomConfig5678
target: /foo.txt
variable: varName
Copy files to slave before build Requires the Jenkins Copy To Slave Plugin.
Parameters: |
|
---|
Example:
wrappers:
- copy-to-slave:
includes:
- file1
- file2*.txt
excludes:
- file2bad.txt
Binds credentials to environment variables using the credentials binding plugin for jenkins.
Requires the Jenkins Credentials Binding Plugin version 1.1 or greater.
Parameters: | binding-type (list) – List of each bindings to create. Bindings may be of type zip-file, file, username-password, text or username-password-separated. username-password sets a variable to the username and password given in the credentials, separated by a colon. username-password-separated sets one variable to the username and one variable to the password given in the credentials.
|
---|
Example:
wrappers:
- credentials-binding:
- zip-file:
credential-id: b3e6f337-5d44-4f57-921c-1632d796caa6
variable: CONFIG_ZIP
- file:
credential-id: b3e6f337-5d44-4f57-921c-1632d796caab
variable: config_file
- username-password:
credential-id: b3e6f337-5d44-4f57-921c-1632d796caac
variable: config_username_password
- text:
credential-id: b3e6f337-5d44-4f57-921c-1632d796caad
variable: config_text
- username-password-separated:
credential-id: b3e6f337-5d44-4f57-921c-1632d796caae
username: myUsername
password: myPassword
Requires the Jenkins Custom Tools Plugin.
Parameters: |
|
---|
Example:
wrappers:
- custom-tools:
tools:
- my_custom_tool
skip-master-install: true
convert-homes-to-upper: true
If enabled the job will create a version based on the template. The version will be set to the environment variable PIPELINE_VERSION and will also be set in the downstream jobs.
Requires the Jenkins Delivery Pipeline Plugin.
Parameters: |
|
---|
Example:
wrappers:
- delivery-pipeline:
version-template: 1.0.0-${BUILD_NUMBER}
set-display-name: true
Add or override environment variables to the whole build process Requires the Jenkins Environment File Plugin.
Parameters: | properties-file (str) – path to the properties file (default ‘’) |
---|
Example:
wrappers:
- env-file:
properties-file: ${WORKSPACE}/foo
Add or override environment variables to the whole build process. Requires the Jenkins Environment Script Plugin.
Parameters: |
|
---|
Example:
wrappers:
- env-script:
script-content: 'echo foo=bar'
only-run-on-parent: true
Add a resource to use for critical sections to establish a mutex on. If another job specifies the same resource, the second job will wait for the blocked resource to become available.
Requires the Jenkins Exclusion Plugin.
Parameters: | resources (list) – List of resources to add for exclusion |
---|
Example:
wrappers:
- exclusion:
resources:
- myresource1
- myresource2
Add or override environment variables to the whole build process Requires the Jenkins EnvInject Plugin.
Parameters: |
|
---|
Example:
wrappers:
- inject:
properties-file: /usr/local/foo
properties-content: PATH=/foo/bar
script-file: /usr/local/foo.sh
script-content: echo $PATH
Inject ownership variables to the build as environment variables. Requires the Jenkins EnvInject Plugin and Jenkins Ownership plugin.
Parameters: |
|
---|
Example:
wrappers:
- inject-ownership-variables:
job-variables: true
node-variables: true
Inject passwords to the build as environment variables. Requires the Jenkins EnvInject Plugin.
Parameters: |
|
---|
Example:
wrappers:
- inject-passwords:
global: true
mask-password-params: true
job-passwords:
- name: ADMIN
password: 0v8ZCNaHwq1hcx+sHwRLdg9424uBh4Pin0zO4sBIb+U=
Uses JClouds to provide slave launching on most of the currently usable Cloud infrastructures. Requires the Jenkins JClouds Plugin.
Parameters: |
|
---|
Example:
wrappers:
- jclouds:
single-use: True
instances:
- jenkins-dev-slave:
cloud-name: mycloud1
count: 1
stop-on-terminate: True
- jenkins-test-slave:
cloud-name: mycloud2
count: 2
stop-on-terminate: False
Enable writing the job log to the underlying logging system. Requires the Jenkins Job Log Logger plugin.
Parameters: | suppress-empty (bool) – Suppress empty log messages (default: true) |
---|
Example:
wrappers:
- job-log-logger:
suppress-empty: false
Show live screenshots of running jobs in the job list. Requires the Jenkins Live-Screenshot Plugin.
Parameters: |
|
---|
File type must be .png and they must be located inside the $WORKDIR.
Example using defaults:
wrappers:
- live-screenshot
or specifying the files to use:
wrappers:
- live-screenshot:
full-size: my_screenshot.png
thumbnail: my_screenshot-thumb.png
Control parallel execution of jobs. Requires the Jenkins Locks and Latches Plugin.
Arg: | list of locks to use |
---|
Example:
wrappers:
- locks:
- FOO
- FOO2
Abort the build if its logfile becomes too big. Requires the Jenkins Logfilesizechecker Plugin.
Parameters: |
|
---|
Minimum config example:
wrappers:
- logfilesize
Full config example:
wrappers:
- logfilesize:
set-own: true
size: 1024
fail: true
Dump the Jenkins console output to Logstash Requires the Jenkins logstash plugin.
Parameters: |
|
---|
Example:
wrappers:
- logstash:
use-redis: True
redis:
host: 'localhost'
port: 6379
database-number: 0
database-password: 'password'
data-type: 'list'
key: 'logstash'
Configure M2 Repository Cleanup Requires the Jenkins M2 Repository Cleanup.
Parameters: | patterns (list) – List of patterns for artifacts to cleanup before building. (optional) |
---|
This plugin allows you to configure a maven2 job to clean some or all of the artifacts from the repository before it runs.
Example:
wrappers: - m2-repository-cleanup: patterns: - com/ibm/** - com/microsoft/**
Hide passwords in the console log. Requires the Jenkins Mask Passwords Plugin.
Example:
wrappers:
- mask-passwords
Tie parent to a node. Requires the Jenkins Matrix Tie Parent Plugin. Note that from Jenkins version 1.532 this plugin’s functionality is available under the “advanced” option of the matrix project configuration. You can use the top level node parameter to control where the parent job is tied in Jenkins 1.532 and higher.
Parameters: | node (str) – Name of the node. |
---|
Example:
project-type: matrix
wrappers:
- matrix-tie-parent:
node: Unix
Initalizes a MongoDB database while running the build. Requires the Jenkins MongoDB plugin.
Parameters: |
|
---|
Example:
wrappers:
- mongo-db:
name: 2.4.6
data-directory: /var/tmp/mongo
port: 5555
startup-params: "--bind_ip 127.0.0.1"
start-timeout: 5000
Requires the Jenkins NodeJS Plugin.
Parameters: | name (str) – nodejs installation name |
---|
Example:
wrappers:
- nodejs-installator:
name: "latest node"
This plugin allows SCM-triggered jobs to ignore build requests if only certain paths have changed.
Requires the Jenkins Pathignore Plugin.
Parameters: | ignored (str) – A set of patterns to define ignored changes |
---|
Example:
wrappers:
- pathignore:
ignored: "docs, tests"
Assign unique TCP port numbers Requires the Jenkins Port Allocator Plugin.
Parameters: |
|
---|
Example:
wrappers:
- port-allocator:
names:
- SERVER_PORT
- SERVER_PORT2
Execute a Build Step before running the SCM Requires the Jenkins pre-scm-buildstep.
Parameters: | buildsteps (list) – List of build steps to execute
|
---|
Example:
wrappers:
- pre-scm-buildstep:
- shell: |
#!/bin/bash
echo "Doing somethiung cool"
- shell: |
#!/bin/zsh
echo "Doing somethin cool with zsh"
- ant: "target1 target2"
ant-name: "Standard Ant"
- inject:
properties-file: example.prop
properties-content: EXAMPLE=foo-bar
Set the rbenv implementation. Requires the Jenkins rbenv plugin.
All parameters are optional.
Parameters: |
|
---|
Example:
wrappers:
- rbenv:
ruby-version: 2.0.0-p353
ignore-local-version: false
preinstall-gem-list: "bundler,rake"
rbenv-root: "$HOME/.rbenv"
rbenv-repo: "https://github.com/sstephenson/rbenv.git"
rbenv-branch: "master"
ruby-build-repo: "https://github.com/sstephenson/ruby-build.git"
ruby-build-branch: "master"
Add release build configuration Requires the Jenkins Release Plugin.
Parameters: |
|
---|
Example:
wrappers:
- release:
keep-forever: false
parameters:
- string:
name: RELEASE_BRANCH
default: ''
description: Git branch to release from.
- bool:
name: FOO
default: false
description: "A parameter named FOO, defaults to 'false'."
post-success:
- shell: |
#!/bin/bash
copy_build_artefacts.sh
Set the RVM implementation Requires the Jenkins Rvm Plugin.
Parameters: | implementation (str) – Type of implementation. Syntax is RUBY[@GEMSET], such as ‘1.9.3’ or 'jruby@foo‘. |
---|
Example:
wrappers:
- rvm-env:
implementation: 1.9.3
Allows you to integrate Sauce OnDemand with Jenkins. You can automate the setup and tear down of Sauce Connect and integrate the Sauce OnDemand results videos per test. Requires the Jenkins Sauce OnDemand Plugin.
Parameters: |
|
---|
Example:
wrappers:
- sauce-ondemand:
enable-sauce-connect: true
sauce-host: foo
sauce-port: 8080
override-username: foo
override-api-access-key: 123lkj123kh123l;k12323
type: webdriver
platforms:
- Linuxandroid4
- Linuxfirefox10
- Linuxfirefox11
launch-sauce-connect-on-slave: true
Sets up the user for the ssh agent plugin for jenkins.
Requires the Jenkins SSH-Agent Plugin.
Parameters: |
|
---|
Example:
wrappers:
- ssh-agent-credentials:
users:
- '44747833-247a-407a-a98f-a5a2d785111c'
- 'f1c0f777-7ac6-43fd-b5c7-68b420aa1392'
- 'dd647a01-be21-402b-bfc5-a4e89be7d0c4'
Example:
wrappers:
- ssh-agent-credentials:
user: '49d20745-9889-4c02-b286-fc6fb89c36bd'
users:
- '44747833-247a-407a-a98f-a5a2d785111c'
- 'dd647a01-be21-402b-bfc5-a4e89be7d0c4'
The users with one value in list equals to the user. In this case old style XML will be generated. Use this format if you use SSH-Agent plugin < 1.5.
Example:
wrappers:
- ssh-agent-credentials:
users:
- '49d20745-9889-4c02-b286-fc6fb89c36bd'
equals to:
wrappers:
- ssh-agent-credentials:
user: '49d20745-9889-4c02-b286-fc6fb89c36bd'
Abort the build if it runs too long. Requires the Jenkins Build Timeout Plugin.
Parameters: |
|
---|
Example (Version < 1.14):
wrappers:
- timeout:
timeout: 90
timeout-var: 'BUILD_TIMEOUT'
fail: true
type: absolute
wrappers:
- timeout:
fail: false
type: likely-stuck
wrappers:
- timeout:
timeout-var: 'BUILD_TIMEOUT'
fail: true
elastic-percentage: 150
elastic-default-timeout: 90
type: elastic
Example (Version >= 1.14):
wrappers:
- timeout:
timeout: 90
timeout-var: 'BUILD_TIMEOUT'
fail: true
type: absolute
wrappers:
- timeout:
timeout: 5
timeout-var: 'BUILD_TIMEOUT'
type: no-activity
abort: true
write-description: "Blah Blah Blah"
wrappers:
- timeout:
timeout: 90
timeout-var: 'BUILD_TIMEOUT'
abort: true
type: likely-stuck
wrappers:
- timeout:
elastic-percentage: 150
elastic-default-timeout: 3
elastic-number-builds: 14
timeout-var: 'BUILD_TIMEOUT'
abort: true
type: elastic
Add timestamps to the console log. Requires the Jenkins Timestamper Plugin.
Example:
wrappers:
- timestamps
Requires the Jenkins Workspace Cleanup Plugin.
The post-build workspace-cleanup is available as a publisher.
Parameters: |
|
---|
Example:
wrappers:
- workspace-cleanup:
include:
- "*.zip"
Enable xvfb during the build. Requires the Jenkins Xvfb Plugin.
Parameters: |
|
---|
Example:
wrappers:
- xvfb:
installation-name: default
auto-display-name: false
display-name: 123
assigned-labels: nodes-xxx
parallel-build: false
timeout: 10
screen: 1024x768x16
display-name-offset: 100
additional-options: -fbdir /tmp
debug: true
shutdown-with-build: false
Enable xvnc during the build. Requires the Jenkins xvnc plugin.
Parameters: |
|
---|
Example:
wrappers:
- xvnc:
screenshot: true
xauthority: false