The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.
For a list of other such plugins, see the Pipeline Steps Reference page.
container
: Run build steps in a containername : String
shell : String
(optional)
Specifies a shell which will run inside the container and process requests from Jenkins to run executables, set environment variables, and similar infrastructure.
This does not affect the shell used to run user code, such as sh
steps. To run your scripts with a specific shell on Linux, use an interpreter line:
sh '''#!/bin/bash
for x in {0..9}; do echo x; done
'''
or just use a subprocess and an externally versioned script:
sh 'bash ci.sh'
On Windows, choose between the bat
or powershell
steps.
For a pod running on Linux, defaults to sh
, which should be in $PATH
; for a pod running on Windows, defaults to cmd
, which should be in %Path%
. Should not generally be overridden.
podTemplate
: Define a podTemplate to use in the kubernetes pluginDefines a Kubernetes pod template that can be used to create nodes.
Example:
podTemplate(...) { node(POD_LABEL) { // some steps } }
activeDeadlineSeconds : int
(optional)
agentContainer : String
(optional)
agentInjection : boolean
(optional)
annotations
(optional)
key : String
key : String
value : String
value : String
cloud : String
(optional)
containers
(optional)
name : String
name : String
jnlp
, and runs the Jenkins agent. In order to replace the default agent image, the container with the agent must be named jnlp
.image : String
image : String
alwaysPullImage : boolean
alwaysPullImage : boolean
(optional)
args : String
args : String
(optional)
Arguments to pass to the command.
${computer.jnlpmac}
and ${computer.name}
are replaced with the agent secret and name respectively.
For Windows containers the args Start-Sleep 999999
are reasonable choices to go with powershell
.
command : String
command : String
(optional)
Override the image entrypoint with a different one.
For Windows containers powershell
is a good default.
envVars
envVars
(optional)
containerEnvVar
containerEnvVar
key : String
value : String
envVar
envVar
key : String
value : String
podEnvVar
podEnvVar
key : String
value : String
secretEnvVar
secretEnvVar
key : String
secretName : String
secretKey : String
optional : boolean
livenessProbe
livenessProbe
(optional)
execArgs : String
execArgs : String
timeoutSeconds : int
timeoutSeconds : int
initialDelaySeconds : int
initialDelaySeconds : int
failureThreshold : int
failureThreshold : int
When a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up.
Giving up in case of liveness probe means restarting the container.
In case of readiness probe the Pod will be marked Unready. Defaults to 3. Minimum value is 1.
periodSeconds : int
periodSeconds : int
How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.
successThreshold : int
successThreshold : int
ports
ports
(optional)
name : String
name : String
(optional)
containerPort : int
containerPort : int
(optional)
hostPort : int
hostPort : int
(optional)
privileged : boolean
privileged : boolean
(optional)
resourceLimitCpu : String
resourceLimitCpu : String
(optional)
resourceLimitEphemeralStorage : String
resourceLimitEphemeralStorage : String
(optional)
resourceLimitMemory : String
resourceLimitMemory : String
(optional)
resourceRequestCpu : String
resourceRequestCpu : String
(optional)
resourceRequestEphemeralStorage : String
resourceRequestEphemeralStorage : String
(optional)
resourceRequestMemory : String
resourceRequestMemory : String
(optional)
runAsGroup : String
runAsGroup : String
(optional)
runAsUser : String
runAsUser : String
(optional)
shell : String
shell : String
(optional)
ttyEnabled : boolean
ttyEnabled : boolean
(optional)
workingDir : String
workingDir : String
(optional)
envVars
(optional)
containerEnvVar
containerEnvVar
key : String
value : String
envVar
envVar
key : String
value : String
podEnvVar
podEnvVar
key : String
value : String
secretEnvVar
secretEnvVar
key : String
secretName : String
secretKey : String
optional : boolean
hostNetwork : boolean
(optional)
idleMinutes : int
(optional)
imagePullSecrets : Array / List of String
(optional)
inheritFrom : String
(optional)
inheritYamlMergeStrategy : boolean
(optional)
instanceCap : int
(optional)
label : String
(optional)
POD_LABEL
so you can use this as the argument to the node
step.
podTemplate(...) { node(POD_LABEL) { // some steps } }
name : String
(optional)
namespace : String
(optional)
nodeSelector : String
(optional)
nodeUsageMode : String
(optional)
podRetention
(optional)
always
always
default
default
never
never
onFailure
onFailure
runAsGroup : String
(optional)
runAsUser : String
(optional)
schedulerName : String
(optional)
serviceAccount : String
(optional)
showRawYaml : boolean
(optional)
slaveConnectTimeout : int
(optional)
supplementalGroups : String
(optional)
volumes
(optional)
configMapVolume
configMapVolume
mountPath : String
configMapName : String
optional : boolean
subPath : String
(optional)
dynamicPVC
dynamicPVC
accessModes : String
(optional)
mountPath : String
(optional)
requestsSize : String
(optional)
storageClassName : String
(optional)
emptyDirVolume
emptyDirVolume
mountPath : String
memory : boolean
genericEphemeralVolume
genericEphemeralVolume
accessModes : String
(optional)
mountPath : String
(optional)
requestsSize : String
(optional)
storageClassName : String
(optional)
hostPathVolume
hostPathVolume
hostPath : String
mountPath : String
readOnly : boolean
nfsVolume
nfsVolume
serverAddress : String
serverPath : String
readOnly : boolean
mountPath : String
persistentVolumeClaim
persistentVolumeClaim
mountPath : String
claimName : String
readOnly : boolean
secretVolume
secretVolume
mountPath : String
secretName : String
defaultMode : String
optional : boolean
workingDir : String
(optional)
workspaceVolume
(optional)
dynamicPVC
dynamicPVC
accessModes : String
(optional)
requestsSize : String
(optional)
storageClassName : String
(optional)
emptyDirWorkspaceVolume
emptyDirWorkspaceVolume
memory : boolean
genericEphemeralVolume
genericEphemeralVolume
accessModes : String
(optional)
requestsSize : String
(optional)
storageClassName : String
(optional)
hostPathWorkspaceVolume
hostPathWorkspaceVolume
hostPath : String
nfsWorkspaceVolume
nfsWorkspaceVolume
serverAddress : String
serverPath : String
readOnly : boolean
persistentVolumeClaimWorkspaceVolume
persistentVolumeClaimWorkspaceVolume
claimName : String
readOnly : boolean
yaml : String
(optional)
yamlMergeStrategy
(optional)
merge
merge
override
override
kubeconfig
: Setup Kubernetes CLI (kubectl)serverUrl : String
credentialsId : String
caCertificate : String
Leaving this field empty will skip the certificate verification.
containerLog
: Get container log from Kubernetesname : String
containerTemplate
.
limitBytes : int
(optional)
returnLog : boolean
(optional)
sinceSeconds : int
(optional)
tailingLines : int
(optional)
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.