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
Stringshell (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.
StringpodTemplate: 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 (optional)
intannotations (optional)
key
Stringvalue
Stringcloud (optional)
Stringcontainers (optional)
name
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.Stringimage
hudson.remoting.jnlp.Main.StringalwaysPullImage (optional)
booleanargs (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.
Stringcommand (optional)
Override the image entrypoint with a different one.
For Windows containers powershell is a good default.
StringenvVars (optional)
containerEnvVarkey
Stringvalue
StringenvVarkey
Stringvalue
StringpodEnvVarkey
Stringvalue
StringsecretEnvVarkey
StringsecretName
StringsecretKey
Stringoptional
booleanlivenessProbe (optional)
execArgs
StringtimeoutSeconds
intinitialDelaySeconds
intfailureThreshold
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.
intperiodSeconds
How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.
intsuccessThreshold
intports (optional)
name (optional)
StringcontainerPort (optional)
inthostPort (optional)
intprivileged (optional)
booleanresourceLimitCpu (optional)
StringresourceLimitEphemeralStorage (optional)
StringresourceLimitMemory (optional)
StringresourceRequestCpu (optional)
StringresourceRequestEphemeralStorage (optional)
StringresourceRequestMemory (optional)
StringrunAsGroup (optional)
StringrunAsUser (optional)
Stringshell (optional)
StringttyEnabled (optional)
booleanworkingDir (optional)
StringenvVars (optional)
containerEnvVarkey
Stringvalue
StringenvVarkey
Stringvalue
StringpodEnvVarkey
Stringvalue
StringsecretEnvVarkey
StringsecretName
StringsecretKey
Stringoptional
booleanhostNetwork (optional)
booleanidleMinutes (optional)
intimagePullSecrets (optional)
StringinheritFrom (optional)
StringinstanceCap (optional)
intlabel (optional)
POD_LABEL so you can use this as the argument to the node step.
podTemplate(...) {
node(POD_LABEL) {
// some steps
}
}
Stringname (optional)
Stringnamespace (optional)
StringnodeSelector (optional)
StringnodeUsageMode (optional)
StringpodRetention (optional)
alwaysdefaultneveronFailurerunAsGroup (optional)
StringrunAsUser (optional)
StringschedulerName (optional)
StringserviceAccount (optional)
StringshowRawYaml (optional)
booleanslaveConnectTimeout (optional)
intsupplementalGroups (optional)
Stringvolumes (optional)
configMapVolumemountPath
StringconfigMapName
Stringoptional
booleansubPath (optional)
StringemptyDirVolumemountPath
Stringmemory
booleanhostPathVolumehostPath
StringmountPath
StringnfsVolumeserverAddress
StringserverPath
StringreadOnly
booleanmountPath
StringpersistentVolumeClaimmountPath
StringclaimName
StringreadOnly
booleansecretVolumemountPath
StringsecretName
StringdefaultMode
Stringoptional
booleanworkingDir (optional)
StringworkspaceVolume (optional)
dynamicPVCaccessModes (optional)
StringrequestsSize (optional)
StringstorageClassName (optional)
StringemptyDirWorkspaceVolumememory
booleanhostPathWorkspaceVolumehostPath
StringnfsWorkspaceVolumeserverAddress
StringserverPath
StringreadOnly
booleanpersistentVolumeClaimWorkspaceVolumeclaimName
StringreadOnly
booleanyaml (optional)
StringyamlMergeStrategy (optional)
mergeoverridekubeconfig: Setup Kubernetes CLI (kubectl)serverUrl
StringcredentialsId
StringcaCertificate
Leaving this field empty will skip the certificate verification.
StringcontainerLog: Get container log from Kubernetesname
containerTemplate.
StringlimitBytes (optional)
intreturnLog (optional)
booleansinceSeconds (optional)
inttailingLines (optional)
intPlease 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.