-
Notifications
You must be signed in to change notification settings - Fork 144
83 lines (83 loc) · 2.9 KB
/
ci.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
on:
push:
branches:
- master
pull_request:
jobs:
test-on-minikube:
strategy:
matrix:
k8s:
- v1.26
- v1.27
- v1.28
- v1.29
runs-on: ubuntu-22.04
steps:
- uses: medyagh/[email protected]
with:
kubernetes-version: ${{ matrix.k8s }}
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: azure/setup-helm@v4
- name: testing helm chart
run: |
cd charts/redash
helm lint .
helm dependency build .
cat > test-values.yaml <<- EOM
redash:
cookieSecret: $(openssl rand -base64 32)
secretKey: $(openssl rand -base64 32)
env:
REDASH_WEB_WORKERS: 1
postgresql:
auth:
password: $(openssl rand -base64 32)
worker:
env:
WORKERS_COUNT: 1
EOM
helm upgrade --install redash . --wait -f test-values.yaml
sleep 10
helm test redash
helm delete redash
helm upgrade --install redashup . --wait -f test-values.yaml
kubectl get pod -l "app.kubernetes.io/instance=redashup,app.kubernetes.io/component=server" -o jsonpath="{..image}"
sleep 10
helm test redashup
kubectl delete pod -l "app.kubernetes.io/instance=redashup,app.kubernetes.io/component=test-connection"
helm upgrade --install redashup . --wait --reset-values -f test-values.yaml
kubectl get pod -l "app.kubernetes.io/instance=redashup,app.kubernetes.io/component=server" -o jsonpath="{..image}"
sleep 10
helm test redashup
kubectl top node || true
kubectl top pod -A || true
kubectl get all -A || true
echo "TEST LOGS"
kubectl describe pod "$(kubectl get pods -l 'app.kubernetes.io/component=test-connection' -o jsonpath='{.items[0].metadata.name}')"
kubectl logs --tail=20 -l "app.kubernetes.io/component=test-connection" || true
echo "INSTALL LOGS"
kubectl logs --tail=40 -l "job-name=redash-install" || true
echo "UPGRADE LOGS"
kubectl logs --tail=40 -l "job-name=redash-upgrade" || true
echo "SERVER LOGS"
kubectl logs --tail=20 -l "app.kubernetes.io/component=server" || true
echo "MINIKUBE LOGS"
minikube logs -n10 || true
publish-chart:
needs: test-on-minikube
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: configure git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- uses: helm/[email protected]
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}