-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (41 loc) · 1.62 KB
/
validate.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
name: Validate controller
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
run-controller:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
cluster_name: "k8scluster"
- name: Generate CRD
run: cargo run --bin=crdgen >> crd.yaml
- name: Apply CRD
run: kubectl apply -f crd.yaml
- name: Build Controller
run: docker build -t ext-cardano-dbsync:1.0 .
- name: Load Image into Kind
run: kind load docker-image ext-cardano-dbsync:1.0 --name k8scluster
- name: Apply manifests
run: |
kubectl apply -f test/manifest.yaml
kubectl apply -f test/dbsyncport.yaml
- name: Validate if CRD is working
run: |
sleep 8;
kubectl describe dbsyncports.demeter.run --namespace project useraccess | grep -oP 'Username: \K\S+'
kubectl describe dbsyncports.demeter.run --namespace project useraccess | grep -oP 'Password: \K\S+'
kubectl describe dbsyncports.demeter.run --namespace project useraccess
counter=0; while ((counter++ < 6)); do kubectl logs -n project "$(kubectl get pods -n project | grep -oP 'controller-\w+-\w+')"; sleep 2; done;
# - name: Collect controller status
# run: |
# kubectl describe dbsyncports.demeter.run --namespace project useraccess | grep -oP 'Password: \K\S+'
# kubectl describe dbsyncports.demeter.run --namespace project useraccess | grep -oP 'Username: \K\S+'