Upgrade to SonarQube 10.7 #100
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 ictu/sonar:ci-latest . | |
eval $(minikube -p minikube docker-env) | |
minikube image load ictu/sonar:ci-latest | |
kubectl apply -f helm/deploy-ci.yaml | |
helm dependency build helm | |
helm upgrade --set-json='sonarqube.elasticsearch.bootstrapChecks="false"' --set-json='sonarqube.image.tag="ci-latest"' --install --render-subchart-notes ictu-sonarqube helm | |
- name: Disable ES disk watermark checks | |
run: | | |
eval $(minikube -p minikube docker-env) | |
kubectl wait pod/ictu-sonarqube-sonarqube-0 --timeout=1m --for=jsonpath='{.status.phase}'=Running | |
kubectl logs -f pod/ictu-sonarqube-sonarqube-0 |& sed "/app\[\]\[o.s.a.SchedulerImpl\] Process\[es\] is up/ q" | |
kubectl exec pod/ictu-sonarqube-sonarqube-0 -- curl -s -XPUT "http://localhost:9001/_cluster/settings" -H "Content-Type: application/json" -d '{"transient":{"cluster.routing.allocation.disk.threshold_enabled":false}}' | |
timeout-minutes: 2 | |
- 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=5m --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: 6 |