2026-10-17 13:50:19 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
root=$(cd -- "$(dirname -- "$0")" && pwd)
|
|
|
|
|
if [[ ${FACTORIO_CI:-false} != true ]]; then
|
|
|
|
|
[[ $(kubectl config current-context) == kubernetes-admin@kubernetes ]] || { echo 'Wrong Kubernetes context' >&2; exit 1; }
|
|
|
|
|
fi
|
|
|
|
|
work=$(mktemp -d)
|
|
|
|
|
trap 'rm -rf "$work"' EXIT
|
|
|
|
|
"$root/render.sh" > "$work/rendered.yaml"
|
2026-10-17 16:34:59 +02:00
|
|
|
python3 "$root/scripts/prepare-deploy.py" "$work/rendered.yaml" > "$work/apply.yaml"
|
2026-10-17 13:50:19 +02:00
|
|
|
kubectl apply --dry-run=server -f "$work/apply.yaml"
|
|
|
|
|
kubectl apply -f "$work/apply.yaml"
|
|
|
|
|
if ! kubectl -n factorio rollout status deployment/factorio --timeout=1800s; then
|
|
|
|
|
kubectl -n factorio get deployment factorio -o yaml
|
|
|
|
|
kubectl -n factorio get pods -o wide
|
|
|
|
|
kubectl -n factorio get events --sort-by=.lastTimestamp
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|