Files
feedc0de 1aa4d28a60
Test and deploy Factorio / validate (push) Successful in 30s
Test and deploy Factorio / deploy (push) Successful in 17s
Use simple preferred scheduling for Factorio
2026-10-17 16:34:59 +02:00

21 lines
993 B
Bash
Executable File

#!/usr/bin/env bash
# One-time administrator bootstrap. Routine deployments use install.sh and limited RBAC.
set -euo pipefail
root=$(cd -- "$(dirname -- "$0")" && pwd)
[[ $(kubectl config current-context) == kubernetes-admin@kubernetes ]] || { echo 'Wrong Kubernetes context' >&2; exit 1; }
kubectl apply --dry-run=server -f "$root/namespace.yaml"
kubectl apply -f "$root/namespace.yaml"
for file in ci-deployer.yaml; do
kubectl apply --dry-run=server -f "$root/$file"
kubectl apply -f "$root/$file"
done
if ! kubectl -n factorio get secret factorio-runtime >/dev/null 2>&1; then
python3 - <<'PY' | kubectl create -f -
import base64,json,secrets
print(json.dumps({'apiVersion':'v1','kind':'Secret','metadata':{'name':'factorio-runtime','namespace':'factorio'},'type':'Opaque','data':{'rcon-password':base64.b64encode(secrets.token_urlsafe(32).encode()).decode()}}))
PY
fi
"$root/render.sh" | kubectl apply --dry-run=server -f -
"$root/render.sh" | kubectl apply -f -
"$root/install.sh"