Something went wrong. Try again.
APNs relay for Prefect for iOS: pushes a flow run's pause to your phone
Something went wrong. Try again.
prefect-push justfile
2.2 kB · 49 lines
Just
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950# prefect-push: APNs relay for Prefect for iOS
export KUBECONFIG := env("KUBECONFIG", source_directory() / "../my-prefect-server/kubeconfig.yaml")
namespace := "prefect"health := "https://prefect-server.waow.tech/push/health"
# types and testscheck: bun install --frozen-lockfile bun run check
# run against a server: PREFECT_API_URL (and PREFECT_API_AUTH_STRING) must be setdev: bun --watch src/main.ts
# ship the committed source to the cluster and wait for it to answerdeploy: check #!/usr/bin/env bash set -euo pipefail if [ -n "$(git status --porcelain -- src deploy)" ]; then echo "src/ or deploy/ has uncommitted changes; commit before deploying" >&2 exit 1 fi rev=$(git rev-parse --short HEAD) files=$(ls src/*.ts | grep -v -e '\.test\.ts$' -e '/fakes\.ts$' | sed 's/^/--from-file=/') kubectl -n {{ namespace }} create configmap prefect-push-src $files --dry-run=client -o yaml | kubectl apply -f - kubectl apply -f deploy/prefect-push.yaml kubectl -n {{ namespace }} annotate deployment prefect-push prefect-push/revision="$rev" --overwrite kubectl -n {{ namespace }} patch deployment prefect-push --type merge \ -p "{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"prefect-push/revision\":\"$rev\"}}}}}" kubectl -n {{ namespace }} rollout status deployment/prefect-push --timeout=120s curl -fsS {{ health }} && echo
# give the relay its APNs key: just apns-key ~/Downloads/AuthKey_ABC123DEFG.p8 ABC123DEFG TEAMID1234apns-key p8 key_id team_id: kubectl -n {{ namespace }} create secret generic prefect-push-apns \ --from-file=key={{ p8 }} --from-literal=key-id={{ key_id }} --from-literal=team-id={{ team_id }} \ --dry-run=client -o yaml | kubectl apply -f - kubectl -n {{ namespace }} rollout restart deployment/prefect-push kubectl -n {{ namespace }} rollout status deployment/prefect-push --timeout=120s curl -fsS {{ health }} && echo
status: kubectl -n {{ namespace }} get deploy,pod -l app=prefect-push curl -fsS {{ health }} && echo
logs *args: kubectl -n {{ namespace }} logs deploy/prefect-push {{ args }}