Skip to content

Instantly share code, notes, and snippets.

@WolfgangOfner
Created September 12, 2021 10:01
Show Gist options
  • Save WolfgangOfner/4baac64aa588117648a2beb7a451c8f9 to your computer and use it in GitHub Desktop.
Save WolfgangOfner/4baac64aa588117648a2beb7a451c8f9 to your computer and use it in GitHub Desktop.
- stage: PR_Delete
dependsOn: PR_Deploy
condition: succeeded('PR_Deploy')
variables:
K8sNamespace: '$(ApiName)-pr-$(prId)'
jobs:
- deployment: Delete_PR_Namespace
environment: "customerapi-PR-Delete"
displayName: Build and push Docker image and create Helm package
strategy:
runOnce:
deploy:
steps:
- download: none
- template: templates/GetPrId.yml
- task: Kubernetes@1
inputs:
connectionType: 'Azure Resource Manager'
azureSubscriptionEndpoint: 'AzureServiceConnection'
azureResourceGroup: $(ClusterResourceGroup)
kubernetesCluster: $(KubernetesCluster)
useClusterAdmin: true
command: 'delete'
arguments: 'namespaces $(k8sNamespace)'
displayName: 'Delete PR namespace'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment