Wrappers can alter the way the build is run as well as the build output.
Macro: | wrapper |
---|---|
Entry Point: | jenkins_jobs.wrappers |
Example:
job:
name: test_job
wrappers:
- timeout:
timeout: 90
fail: true
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
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
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
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 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 passwords to the build as environment variables. Requires the Jenkins EnvInject Plugin.
Parameters: |
|
---|
Example:
wrappers:
- inject-passwords:
global: 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
Control parallel execution of jobs. Requires the Jenkins Locks and Latches Plugin.
Arg: | list of locks to use |
---|
Example:
wrappers:
- locks:
- FOO
- FOO2
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'
Hide passwords in the console log. Requires the Jenkins Mask Passwords Plugin.
Example:
wrappers:
- mask-passwords
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: | name (str) – Variable name of the port or a specific port number |
---|
Example:
wrappers:
- port-allocator:
name: SERVER_PORT
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.
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
Abort the build if it runs too long. Requires the Jenkins Build Timeout Plugin.
Parameters: |
|
---|
Example:
wrappers:
- timeout:
timeout: 90
fail: true
type: absolute
wrappers:
- timeout:
fail: false
type: likely-stuck
wrappers:
- timeout:
fail: true
elastic-percentage: 150
elastic-default-timeout: 90
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"