Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 880 Bytes

withDeployment.md

File metadata and controls

26 lines (20 loc) · 880 Bytes

withDeployment

This step, given a YAML file, deploys it (apply), runs some code in its body, and optionally undeploys it (delete).

The kubectl must already be configured (see withDigitalOceanK8SCluster for example).

Parameters

Parameter Type Default Description
file String Required Path, relative to the workspace or the current directory, to the file to apply
delete boolean true If true, the kubectl delete -f command is run against the same file at the end of this step's execution.

Example

withDigitalOceanK8SCluster(...) { cluster ->
   withDeployment(
      file: "deployment.yaml",
      delete: true,
   ) {
      // Runs some code after deployment is started...
   }
   // Here, the deployment.yaml has been deleted (kubectl delete -f)
}