-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (50 loc) · 2.02 KB
/
helm-chart.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
---
name: Helm Chart CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- env:
IMAGE_EDITION: community
- env:
IMAGE_EDITION: developer
steps:
- uses: actions/checkout@v4
- name: Set yaml value change dict with random generated secrets
run: |
echo "VALUE_CHANGES={\"[0].data.sonar_db_password\":\"$(echo ${RANDOM} | md5sum | head -c 16 | base64)\",\"[0].data.postgres_db_password\":\"$(echo ${RANDOM} | base64)\",\"[1].data.SONARQUBE_USERNAME\":\"$(echo admin | base64)\",\"[1].data.SONARQUBE_PASSWORD\":\"$(echo ${RANDOM} | md5sum | head -c 16 | base64)\"}" >> $GITHUB_ENV
- name: Update values.yaml
uses: fjogeleit/[email protected]
with:
valueFile: "helm/deploy-ci.yaml"
commitChange: false
changes: ${{ env.VALUE_CHANGES }}
- name: Start minikube
uses: medyagh/setup-minikube@latest
with:
driver: docker
container-runtime: containerd
timeout-minutes: 2
- name: Build and run chart
run: |
docker build --build-arg="IMAGE_EDITION=${{ matrix.env.IMAGE_EDITION }}" -t ci .
eval $(minikube -p minikube docker-env)
kubectl apply -f helm/deploy-ci.yaml
helm dependency build helm
helm upgrade --install --render-subchart-notes ictu-sonarqube helm
- name: Wait for Sonar instance to start
# profile for language 'web' is the last; assume everything is working if we got this far
run: |
eval $(minikube -p minikube docker-env)
kubectl wait --all pods --timeout=4m --for=condition=Ready
kubectl wait --all statefulsets --timeout=30s --for=jsonpath=status.availableReplicas=1
kubectl logs -f pod/ictu-sonarqube-sonarqube-0 |& sed "/Current profile for language 'web' is 'Sonar way'/ q"
timeout-minutes: 5