tori/scripts/deploy.sh
Fam Zheng a26950c432 Add OCI ARM64 deployment setup
- deploy.sh: local-to-OCI deploy script (rsync config, docker build, kubectl apply)
- deployment.yaml: namespace, PVC, Deployment with registry image, Service
- Dockerfile: COPY config.yaml directly into image, drop openssh-client

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:47:11 +00:00

26 lines
679 B
Bash
Executable File

#!/bin/bash
# Deploy tori to OCI k3s cluster
# Run from local machine: scripts/deploy.sh
set -euo pipefail
OCI_HOST="oci"
OCI_DIR="~/src/tori"
IMAGE="registry.oci.euphon.net/tori:latest"
echo "==> Syncing config.yaml to OCI..."
rsync -az config.yaml "${OCI_HOST}:${OCI_DIR}/config.yaml"
echo "==> Pushing code to OCI..."
git push origin main
ssh "$OCI_HOST" "cd $OCI_DIR && git pull"
echo "==> Building and deploying on OCI..."
ssh "$OCI_HOST" "cd $OCI_DIR && \
docker build -t $IMAGE . && \
docker push $IMAGE && \
kubectl apply -f deploy/ && \
kubectl rollout restart deployment/tori -n tori && \
kubectl rollout status deployment/tori -n tori"
echo "==> Done!"