-
Notifications
You must be signed in to change notification settings - Fork 64
91 lines (84 loc) · 3.61 KB
/
deploy.yaml
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
name: Deployment Test Suite
concurrency:
group: deploy-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
jobs:
deployment:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
install:
- static
- helm
emqx:
- [EmqxBroker, emqx, "config/samples/emqx/v1beta3/emqxbroker-slim.yaml"]
# - [EmqxBroker, emqx, "config/samples/emqx/v1beta3/emqxbroker-full.yaml"]
- [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta3/emqxenterprise-slim.yaml"]
# - [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta3/emqxenterprise-full.yaml"]
- [EmqxBroker, emqx, "config/samples/emqx/v1beta4/emqxbroker-slim.yaml"]
- [EmqxBroker, emqx, "config/samples/emqx/v1beta4/emqxbroker-full.yaml"]
- [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta4/emqxenterprise-slim.yaml"]
- [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta4/emqxenterprise-full.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2alpha1/emqx-slim.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2alpha1/emqx-full.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-slim.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-full.yaml"]
steps:
- run: minikube start
- name: install cert-manager
run: |
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--set installCRDs=true
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- uses: actions/checkout@v3
- name: Build image
env:
IMG: "emqx/emqx-operator-controller:${{ github.sha }}"
run: eval $(minikube docker-env) && docker build -t $IMG .
- name: Deploy controller
if: matrix.install == 'static'
env:
IMG: "emqx/emqx-operator-controller:${{ github.sha }}"
run: |
make deploy
kubectl patch -n emqx-operator-system deployment emqx-operator-controller-manager \
--type=json \
-p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--zap-devel=true"}]'
- name: Deploy controller
if: matrix.install == 'helm'
run: |
helm install emqx-operator deploy/charts/emqx-operator \
--set image.tag=${{ github.sha }} \
--namespace emqx-operator-system \
--create-namespace
kubectl patch -n emqx-operator-system deployment emqx-operator-controller-manager \
--type=json \
-p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--zap-devel=true"}]'
- name: Check operator
timeout-minutes: 5
run: kubectl wait --for=condition=Ready pods -l "control-plane=controller-manager" -n emqx-operator-system
- name: Deployment emqx
timeout-minutes: 5
uses: ./.github/actions/deploy-emqx
with:
kind: ${{ matrix.emqx[0] }}
name: ${{ matrix.emqx[1] }}
file: ${{ matrix.emqx[2] }}
- if: failure()
run: kubectl logs -l "control-plane=controller-manager" -n emqx-operator-system -c manager --tail=1000
- if: failure()
run: kubectl get ${{ matrix.emqx[0] }} ${{ matrix.emqx[1] }} -o json
- if: failure()
run: kubectl get events --sort-by='.lastTimestamp'
- if: failure()
run: kubectl logs -l "apps.emqx.io/managed-by=emqx-operator" -c emqx