rdev/scripts/build-push.sh
jordan 0960b17eb2 feat: Implement v0.2-v0.4 (workspaces, git, API)
v0.2 - Real Workspaces:
- Project-specific claudebox StatefulSets (pantheon, aeries)
- Init containers for git clone via SSH
- Deploy key secrets template
- Project ConfigMaps for CLAUDE.md

v0.3 - Git Integration:
- Dockerfile with rdev-bot git identity
- openssh-client for SSH operations
- Image version bump to v0.3.0

v0.4 - API Server:
- Go REST API with chi router
- Endpoints: /projects, /claude, /shell, /git, /events
- SSE streaming for real-time output
- OpenAPI docs via Scalar at /docs
- Kubernetes RBAC for pod exec
- Executor and project registry packages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 21:07:00 -07:00

91 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# Build and push rdev images to GitHub Container Registry
#
# Usage:
# ./build-push.sh # Build both images with 'latest' tag
# ./build-push.sh v0.4.0 # Build both images with version tag
# ./build-push.sh v0.4.0 claudebox # Build only claudebox image
# ./build-push.sh v0.4.0 api # Build only api image
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
# Image configuration
REGISTRY="ghcr.io/orchard9"
VERSION="${1:-latest}"
TARGET="${2:-all}"
cd "$PROJECT_ROOT"
build_claudebox() {
local IMAGE_TAG="$REGISTRY/rdev-claudebox:$VERSION"
echo "Building claudebox image..."
echo "Image: $IMAGE_TAG"
echo ""
# Build the image for linux/amd64 (k3s nodes are amd64)
docker build --platform linux/amd64 \
-t "$IMAGE_TAG" \
-t "$REGISTRY/rdev-claudebox:latest" \
-f Dockerfile \
.
echo ""
echo "Pushing claudebox to GitHub Container Registry..."
docker push "$IMAGE_TAG"
docker push "$REGISTRY/rdev-claudebox:latest"
echo "Pushed: $IMAGE_TAG"
}
build_api() {
local IMAGE_TAG="$REGISTRY/rdev-api:$VERSION"
echo "Building rdev-api image..."
echo "Image: $IMAGE_TAG"
echo ""
# Build the image for linux/amd64
docker build --platform linux/amd64 \
-t "$IMAGE_TAG" \
-t "$REGISTRY/rdev-api:latest" \
-f Dockerfile.api \
.
echo ""
echo "Pushing rdev-api to GitHub Container Registry..."
docker push "$IMAGE_TAG"
docker push "$REGISTRY/rdev-api:latest"
echo "Pushed: $IMAGE_TAG"
}
case "$TARGET" in
claudebox)
build_claudebox
;;
api)
build_api
;;
all)
build_claudebox
echo ""
echo "---"
echo ""
build_api
;;
*)
echo "Unknown target: $TARGET"
echo "Usage: $0 [version] [claudebox|api|all]"
exit 1
;;
esac
echo ""
echo "Done!"
echo ""
echo "To deploy, run:"
echo " export KUBECONFIG=~/.kube/orchard9-k3sf.yaml"
echo " kubectl apply -k deployments/k8s/base"