-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (81 loc) · 3.26 KB
/
uninstall-components-az.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Uninstall components from Azure
run-name: Uninstalling component '${{ github.event.inputs.component }}' from AKS cluster
on:
workflow_dispatch:
inputs:
component:
type: choice
description: Which component
required: true
options:
- frontend
- api
- api-mysql
- operator
- operator-stunner
- stunner
- mysql
- grafana
- all
jobs:
uninstall:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Helm
uses: azure/setup-helm@v4.2.0
with:
version: 'latest'
id: install1
- name: Install kubectl
uses: azure/setup-kubectl@v3
with:
version: 'latest'
id: install2
- name: Login to Azure
run: az login --service-principal -u ${{ secrets.CLIENT_ID }} -p ${{ secrets.CLIENT_SECRET }} --tenant ${{ secrets.AZURERM_TENANT_ID }}
- name: Connect to tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{secrets.TAILSCALE_CLIENT_ID_2}}
oauth-secret: ${{secrets.TAILSCALE_CLIENT_SECRET_2}}
tags: tag:ci
- name: Configure kubernetes config
run: tailscale configure kubeconfig tailscale-operator
- name: Uninstall MySQL
working-directory: ./helm/mysql
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'mysql')) }}
run: |
helm uninstall mysql -n mysql --ignore-not-found --wait
helm uninstall mysql-operator -n mysql-operator --ignore-not-found --wait
kubectl delete ns mysql
kubectl delete ns mysql-operator
- name: Uninstall STUNner
working-directory: ./helm/stunner
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'stunner')) }}
run: |
helm uninstall stunner -n stunner --ignore-not-found --wait
kubectl delete ns stunner
- name: Undeploy game operator
working-directory: ./operator
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'operator')) }}
run: make undeploy
- name: Uninstall API
working-directory: ./helm/api
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'api')) }}
run: helm uninstall api
- name: Uninstall frontend
working-directory: ./helm/frontend
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'frontend')) }}
run: helm uninstall frontend
- name: Uninstall Grafana
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'grafana')) }}
run: |
helm uninstall prometheus -n monitoring --ignore-not-found --wait
kubectl delete ns monitoring
- name: Logout of Azure
if: always()
run: az logout