Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (21 sloc) 1004 Bytes
// vars/cloudRunDelete.groovy
def call(Map config) {
def podYaml = libraryResource 'podtemplates/cloud-run.yml'
def label = "cloudrun-${UUID.randomUUID().toString()}"
podTemplate(name: 'cloud-run-pod', label: label, yaml: podYaml, nodeSelector: 'workload=general') {
node(label) {
container(name: 'gcp-sdk') {
echo "region = ${config.region}"
if (config.deployType == "gke") {
sh "gcloud beta run services delete ${config.serviceName} --platform gke --cluster ${config.clusterName} --cluster-location ${config.region} --namespace ${config.namespace} --quiet"
}
else if (config.deployType == "vmware") {
sh "gcloud beta run services delete ${config.serviceName} --platform kubernetes --namespace ${config.namespace} --kubeconfig ${config.kubeconfig} --quiet"
}
else {
sh "gcloud beta run services delete ${config.serviceName} --region ${config.region} --platform managed --quiet"
}
}
}
}
}
You can’t perform that action at this time.