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)
annotations
(optional)
key : String
value : String
cloud : String
(optional)
containers
(optional)
name : String
jnlp
, and runs the Jenkins JNLP agent service. In order to replace the default JNLP agent, the name of the container with the custom JNLP image must be jnlp
.image : String
hudson.remoting.jnlp.Main
.alwaysPullImage : boolean
(optional)
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
(optional)
Override the image entrypoint with a different one.
For Windows containers powershell
is a good default.
envVars
(optional)
containerEnvVar
key : String
value : String
envVar
key : String
value : String
podEnvVar
key : String
value : String
secretEnvVar
key : String
secretName : String
secretKey : String
optional : boolean
livenessProbe
(optional)
execArgs : String
timeoutSeconds : int
initialDelaySeconds : 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
How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.
successThreshold : int
ports
(optional)
name : String
(optional)
containerPort : int
(optional)
hostPort : int
(optional)
privileged : boolean
(optional)
resourceLimitCpu : String
(optional)
resourceLimitEphemeralStorage : String
(optional)
resourceLimitMemory : String
(optional)
resourceRequestCpu : String
(optional)
resourceRequestEphemeralStorage : String
(optional)
resourceRequestMemory : String
(optional)
runAsGroup : String
(optional)
runAsUser : String
(optional)
shell : String
(optional)
ttyEnabled : boolean
(optional)
workingDir : String
(optional)
envVars
(optional)
containerEnvVar
key : String
value : String
envVar
key : String
value : String
podEnvVar
key : String
value : String
secretEnvVar
key : String
secretName : String
secretKey : String
optional : boolean
hostNetwork : boolean
(optional)
idleMinutes : int
(optional)
imagePullSecrets : Array / List of String
(optional)
inheritFrom : String
(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
default
never
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
mountPath : String
configMapName : String
optional : boolean
subPath : String
(optional)
dynamicPVC
accessModes : String
(optional)
mountPath : String
(optional)
requestsSize : String
(optional)
storageClassName : String
(optional)
emptyDirVolume
mountPath : String
memory : boolean
hostPathVolume
hostPath : String
mountPath : String
nfsVolume
serverAddress : String
serverPath : String
readOnly : boolean
mountPath : String
persistentVolumeClaim
mountPath : String
claimName : String
readOnly : boolean
secretVolume
mountPath : String
secretName : String
defaultMode : String
optional : boolean
workingDir : String
(optional)
workspaceVolume
(optional)
dynamicPVC
accessModes : String
(optional)
requestsSize : String
(optional)
storageClassName : String
(optional)
emptyDirWorkspaceVolume
memory : boolean
hostPathWorkspaceVolume
hostPath : String
nfsWorkspaceVolume
serverAddress : String
serverPath : String
readOnly : boolean
persistentVolumeClaimWorkspaceVolume
claimName : String
readOnly : boolean
yaml : String
(optional)
yamlMergeStrategy
(optional)
merge
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.