Skip to content

Commit 4472e35

Browse files
committed
feat: azcopy login
1 parent 6a50013 commit 4472e35

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

.github/workflows/k8_cluster_destroy.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,11 @@ jobs:
6060
AZCOPY_AUTO_LOGIN_TYPE: AZCLI
6161
run: bash cicd-deployment-scripts/k8-cluster/install_azcopy.sh -v ${{ env.AZCOPY_VERSION }}
6262

63-
- name: Delete Storage Share Contents
64-
run: |
65-
azcopy remove \
66-
"https://${{ env.AZURE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_STORAGE_FILE_SHARE }}" \
67-
--exclude-path=caddy/Caddyfile;kratos/identity.schema.json;kratos/kratos.yml;oathkeeper/oathkeeeper.yml;oathkeeper/access-rules.yml;oathkeeper/jwks.json \
68-
--recursive=true
69-
7063
- name: Destroy Cluster Namespace
7164
shell: bash
72-
run: bash cicd-deployment-scripts/k8-cluster/destroy.sh -n ${{ env.KUBERNETES_NAMESPACE }}
65+
run: |
66+
bash cicd-deployment-scripts/k8-cluster/destroy.sh \
67+
-n ${{ env.KUBERNETES_NAMESPACE }} \
68+
-s ${{ env.AZURE_STORAGE_ACCOUNT }} \
69+
-f ${{ env.AZURE_STORAGE_FILE_SHARE }}
7370

k8-cluster/destroy.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,33 @@
22
set -e
33

44
KUBERNETES_NAMESPACE=""
5+
AZURE_STORAGE_ACCOUNT=""
6+
AZURE_STORAGE_FILE_SHARE=""
57

68
while getopts n: flag
79
do
810
case "${flag}" in
911
n) KUBERNETES_NAMESPACE=${OPTARG};;
12+
s) AZURE_STORAGE_ACCOUNT=${OPTARG};;
13+
f) AZURE_STORAGE_FILE_SHARE=${OPTARG};;
1014
esac
1115
done
1216

1317
kubectl config set-context --current --namespace=$KUBERNETES_NAMESPACE
1418
echo "Context set to namespace: \"$KUBERNETES_NAMESPACE\""
1519

20+
azcopy login --identity
21+
azcopy remove \
22+
"https://${AZURE_STORAGE_ACCOUNT}.file.core.windows.net/${AZURE_STORAGE_FILE_SHARE}" \
23+
--exclude-path='
24+
caddy/Caddyfile;
25+
kratos/identity.schema.json;
26+
kratos/kratos.yml;
27+
oathkeeper/oathkeeeper.yml;
28+
oathkeeper/access-rules.yml;
29+
oathkeeper/jwks.json' \
30+
--recursive=true
31+
1632
kubectl delete namespace $KUBERNETES_NAMESPACE
1733
kubectl delete persistentvolumeclaims --all
1834
kubectl delete persistentvolumes --all

0 commit comments

Comments
 (0)