#!/usr/bin/env bash # Build, push and run the tea-verify DaskJob for the current commit. # deploy/verify.sh build + push + apply # deploy/verify.sh --logs follow the job pod's log # deploy/verify.sh --delete remove the DaskJob set -euo pipefail cd "$(dirname "$0")/.." REG=192.168.20.18:5000 case "${1:-}" in --logs) exec kubectl logs -f tea-verify-runner ;; --delete) exec kubectl delete daskjob tea-verify --ignore-not-found ;; esac if [ -n "$(git status --porcelain --ignore-submodules=none)" ]; then echo "uncommitted changes: commit first, so the image tag is a real commit" >&2; exit 1 fi C=$(git rev-parse --short HEAD) docker build -f deploy/Dockerfile.verify --build-arg TEA_COMMIT="$C" -t "$REG/tea-verify:$C" . docker push "$REG/tea-verify:$C" kubectl delete daskjob tea-verify --ignore-not-found sed "s/tea-verify:COMMIT/tea-verify:$C/g" deploy/dask-verify.yaml | kubectl apply -f - echo "applied tea-verify:$C — follow with: deploy/verify.sh --logs"