11ns := " harvest-consultations"
2- helmHost := " mariadb"
2+ mysqlHost := " mariadb"
3+ table := " consultations"
34
45default :
56 just --choose
@@ -13,16 +14,13 @@ kind-up:
1314 kind get clusters | grep -q harvest || kind create cluster --name harvest
1415 helm upgrade --install harvest chart \
1516 - -namespace {{ ns}} --create-namespace \
16- - -set mysql.host={{ helmHost}}
17+ - -set mysql.host={{ mysqlHost}} \
18+ - -set mysql.table={{ table}}
1719
1820# Forward mariadb from k8s cluster
1921mariadb-svc : kind-up
2022 ss -ltpn | grep 3306 || kubectl port-forward service/ mariadb 3306 :3306 -n {{ ns}} & sleep 1
2123
22- # Run the DuckDB pipeline locally
23- run :
24- duckdb -c " .read chart/harvest.sql"
25-
2624# Create a one-off test job in the cluster
2725test : kind-up
2826 kubectl delete job test -n {{ ns}} --ignore-not-found
@@ -32,7 +30,8 @@ test: kind-up
3230helm-install :
3331 helm upgrade --install harvest chart \
3432 - -namespace {{ ns}} --create-namespace \
35- - -set mysql.host={{ helmHost}}
33+ - -set mysql.host={{ mysqlHost}} \
34+ - -set mysql.table={{ table}}
3635
3736# Package helm chart
3837helm-package :
@@ -52,7 +51,8 @@ ci-test:
5251 echo " === CI: installing helm chart ==="
5352 helm upgrade --install harvest chart \
5453 --namespace {{ns}} --create-namespace \
55- --set mysql.host={{helmHost}}
54+ --set mysql.host={{mysqlHost}} \
55+ --set mysql.table={{table}}
5656
5757 echo " === CI: waiting for MariaDB (up to 5 min) ==="
5858 kubectl rollout status statefulset/mariadb -n {{ns}} --timeout=300s
@@ -68,16 +68,16 @@ ci-test:
6868 exit 1
6969 }
7070
71- echo " === CI: dumping consultations table ==="
71+ echo " === CI: dumping {{table}} table ==="
7272 POD=$( kubectl get pod -l app=mariadb -n {{ns}} -o jsonpath=' {.items[0].metadata.name}' )
7373 mkdir -p dist
7474 kubectl exec -n {{ns}} " $POD " -- \
75- sh -c ' MYSQL_PWD="$MARIADB_PASSWORD" exec mariadb-dump -u"$MARIADB_USER" -h 127.0.0.1 harvest consultations ' \
76- | gzip > dist/consultations .sql.gz
75+ sh -c ' MYSQL_PWD="$MARIADB_PASSWORD" exec mariadb-dump -u"$MARIADB_USER" -h 127.0.0.1 harvest {{table}} ' \
76+ | gzip > dist/{{table}} .sql.gz
7777
7878 echo " === CI: validating dump ==="
79- gunzip -c dist/consultations .sql.gz | head -20 || true
80- ROWS=$( gunzip -c dist/consultations .sql.gz | grep -c ' INSERT INTO' || echo 0)
79+ gunzip -c dist/{{table}} .sql.gz | head -20 || true
80+ ROWS=$( gunzip -c dist/{{table}} .sql.gz | grep -c ' INSERT INTO' || echo 0)
8181 echo " Rows found: $ROWS "
8282 if [ " $ROWS " -eq 0 ]; then
8383 echo " ERROR: dump contains no INSERT statements"
0 commit comments