Skip to content

Commit

Permalink
Move chart tests into PR container build actiion
Browse files Browse the repository at this point in the history
  • Loading branch information
jbygdell committed Aug 22, 2023
1 parent 11e31de commit 2dfbe6e
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 102 deletions.
17 changes: 11 additions & 6 deletions .github/integration/scripts/charts/deploy_charts.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/bin/bash
set -ex

if [ -z "$s" ];then
echo "PR number missing"
exit 1
fi

if [ "$1" == "sda-db" ]; then
ROOTPASS=$(yq e '.global.db.password' .github/integration/scripts/charts/values.yaml)
helm install postgres charts/sda-db \
--set image.tag=test-postgres \
--set image.pullPolicy=Never \
--set image.tag="PR$2-postgres" \
--set image.pullPolicy=IfNotPresent \
--set global.postgresAdminPassword="$ROOTPASS" \
--set global.tls.enabled=false \
--set persistence.enabled=false \
Expand All @@ -16,8 +21,8 @@ fi
if [ "$1" == "sda-mq" ]; then
ADMINPASS=$(yq e '.global.broker.password' .github/integration/scripts/charts/values.yaml)
helm install broker charts/sda-mq \
--set image.tag=test-rabbitmq \
--set image.pullPolicy=Never \
--set image.tag="PR$2-rabbitmq" \
--set image.pullPolicy=IfNotPresent \
--set global.adminPassword="$ADMINPASS" \
--set global.adminUser=admin \
--set global.tls.enabled=false \
Expand All @@ -28,8 +33,8 @@ fi

if [ "$1" == "sda-svc" ]; then
helm install pipeline charts/sda-svc \
--set image.tag=test \
--set image.pullPolicy=Never \
--set image.tag="PR$2" \
--set image.pullPolicy=IfNotPresent \
-f .github/integration/scripts/charts/values.yaml \
--wait
fi
57 changes: 56 additions & 1 deletion .github/workflows/build_pr_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,59 @@ jobs:
uses: actions/checkout@v3

- name: Test sensitive-data-archive
run: docker compose -f .github/integration/sda-integration.yml run integration_test
run: docker compose -f .github/integration/sda-integration.yml run integration_test

chart:
needs:
- build_go_images
- build_server_images
- build_java_images
runs-on: ubuntu-latest
strategy:
matrix:
version: ["1.26", "1.27"]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Helm
uses: azure/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Initialise k3d
run: bash .github/integration/scripts/charts/k3d.sh ${{matrix.version}}
shell: bash

- name: debug
if: failure()
run: k3d version list k3s | grep ${{matrix.version}}
shell: bash

- name: Deploy external services
run: bash .github/integration/scripts/charts/dependencies.sh
shell: bash

- name: Deploy DB
run: bash .github/integration/scripts/charts/deploy_charts.sh sda-db ${{ github.event.number }}

- name: Deploy MQ
run: bash .github/integration/scripts/charts/deploy_charts.sh sda-mq ${{ github.event.number }}
shell: bash

- name: Deploy pipeline
run: bash .github/integration/scripts/charts/deploy_charts.sh sda-svc ${{ github.event.number }}
shell: bash

- name: test
if: always()
run: |
kubectl get secret broker-sda-mq -o json
kubectl get secret pipeline-sda-svc-mapper -o json
kubectl get pods
echo "describe mapper" && kubectl describe pod -l role=mapper
sleep 1
echo "logs mapper" && kubectl logs -l role=mapper
sleep 1
echo "describe broker" && kubectl logs -l role=broker
shell: bash
95 changes: 0 additions & 95 deletions .github/workflows/chart_test.yml

This file was deleted.

0 comments on commit 2dfbe6e

Please sign in to comment.