-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (66 loc) · 2.73 KB
/
e2e.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
84
85
name: Run the end-to-end test
on:
pull_request:
branches:
- main
jobs:
e2e:
runs-on: ubuntu-latest
env:
HELM_VERSION: v3.12.2
DOCKER_REGISTRY_PASSWORD: ${{ secrets.CR_PAT }}
DOCKER_REGISTRY_USERNAME: scalar-git
DOCKER_REGISTRY_SERVER: ghcr.io
strategy:
matrix:
productName:
- scalardb
- scalardb-cluster
- scalardl
- scalardl-audit
steps:
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- uses: actions/checkout@v3
- name: Set version
id: version
run: |
VERSION=$(./gradlew :cli:properties -q | grep "version:" | awk '{print $2}')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- uses: helm/[email protected]
with:
cluster_name: kind
- name: Set up helm command
uses: azure/setup-helm@v3
with:
version: ${{ env.HELM_VERSION }}
- name: Add Helm repository
run: |
helm repo add scalar-labs https://scalar-labs.github.io/helm-charts
- name: Create secret resource to pull the containers from GitHub Packages
run: |
kubectl create secret docker-registry reg-docker-secrets --docker-server=${DOCKER_REGISTRY_SERVER} --docker-username=${DOCKER_REGISTRY_USERNAME} --docker-password=${DOCKER_REGISTRY_PASSWORD}
- name: Create secret resource for ScalarDL Auditor
if: ${{ matrix.productName == 'scalardl-audit' }}
run: |
kubectl create secret generic auditor-keys --from-file=certificate=.github/keys-and-certs/auditor-cert.pem --from-file=private-key=.github/keys-and-certs/auditor-key.pem
- name: Deploy Scalar products to Kind
run: |
helm install foo scalar-labs/${{ matrix.productName }} -f .github/manifests/${{ matrix.productName }}.yaml
- name: Deploy client pod
run: |
kubectl apply -f .github/manifests/client-pod.yaml
- name: Wait for Scalar products are started
run: |
kubectl wait --for=condition=Available deployment/$(kubectl get deployment -l app.kubernetes.io/instance=foo,app.kubernetes.io/name=${{ matrix.productName }} -o jsonpath='{.items[0].metadata.name}') --timeout 300s
- name: Build Shadow Jar
run: ./gradlew shadowJar
- name: Copy Shadow Jar to tester Pod
run: |
kubectl wait --for=condition=Ready pod/java8 --timeout 300s
kubectl cp cli/build/libs/scalar-admin-k8s-cli-${{ steps.version.outputs.version }}.jar java8:/tmp
- name: Run Shadow Jar
run: |
kubectl exec -it java8 -- java -jar /tmp/scalar-admin-k8s-cli-${{ steps.version.outputs.version }}.jar -r foo