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.
Example:
wrappers:
- ansicolor
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
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
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
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
Hide passwords in the console log. Requires the Jenkins Mask Passwords Plugin.
Example:
wrappers:
- mask-passwords
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
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
Abort the build if it runs too long. Requires the Jenkins Build Timeout Plugin.
Parameters: |
|
---|
Example:
wrappers:
- timeout:
timeout: 90
fail: true
Add timestamps to the console log. Requires the Jenkins Timestamper Plugin.
Example:
wrappers:
- timestamps
The post-build workspace-cleanup is available as a publisher.
Parameters: |
|
---|
Example:
wrappers:
- workspace-cleanup:
include:
- "*.zip"