Update all hardcoded paths from ~/AI/secrets/* to ~/chorus/business/secrets/* and ~/AI/projects/* to ~/chorus/project-queues/active/* in WHOOSH project files after workspace reorganization. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
64 lines
2.5 KiB
Bash
Executable File
64 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Push WHOOSH images to local registry for swarm deployment
|
|
|
|
set -e
|
|
|
|
LOCAL_REGISTRY="registry.home.deepblack.cloud"
|
|
REGISTRY_PORT="5000"
|
|
NAMESPACE="tony"
|
|
BACKEND_IMAGE="whoosh-backend"
|
|
FRONTEND_IMAGE="whoosh-frontend"
|
|
|
|
# Registry authentication
|
|
REGISTRY_USERNAME="tony"
|
|
REGISTRY_PASSWORD_FILE="/home/tony/chorus/business/secrets/tony-pass"
|
|
|
|
echo "🏗️ Building and pushing WHOOSH images to local registry..."
|
|
|
|
# Change to whoosh directory
|
|
cd "$(dirname "$0")"
|
|
|
|
# Login to registry
|
|
echo "🔐 Logging into registry..."
|
|
if [[ -f "$REGISTRY_PASSWORD_FILE" ]]; then
|
|
cat "$REGISTRY_PASSWORD_FILE" | docker login "$LOCAL_REGISTRY" -u "$REGISTRY_USERNAME" --password-stdin
|
|
else
|
|
echo "❌ Registry password file not found: $REGISTRY_PASSWORD_FILE"
|
|
exit 1
|
|
fi
|
|
|
|
# Build images with docker compose
|
|
echo "🔨 Building images with docker compose..."
|
|
docker compose -f docker-compose.swarm.yml build
|
|
|
|
# Get the actual image names from docker compose
|
|
BACKEND_COMPOSE_IMAGE=$(docker compose -f docker-compose.swarm.yml config | grep "image.*whoosh-backend" | cut -d: -f2- | xargs)
|
|
FRONTEND_COMPOSE_IMAGE=$(docker compose -f docker-compose.swarm.yml config | grep "image.*whoosh-frontend" | cut -d: -f2- | xargs)
|
|
|
|
echo "📦 Found backend image: $BACKEND_COMPOSE_IMAGE"
|
|
echo "📦 Found frontend image: $FRONTEND_COMPOSE_IMAGE"
|
|
|
|
# Tag and push backend with v2
|
|
echo "📦 Tagging and pushing backend image..."
|
|
LOCAL_BACKEND_IMAGE=$(docker images --format "table {{.Repository}}:{{.Tag}}" | grep whoosh.*backend | head -1)
|
|
if [[ -n "$LOCAL_BACKEND_IMAGE" ]]; then
|
|
docker tag "$LOCAL_BACKEND_IMAGE" "${LOCAL_REGISTRY}/${NAMESPACE}/${BACKEND_IMAGE}:v2"
|
|
fi
|
|
docker push "${LOCAL_REGISTRY}/${NAMESPACE}/${BACKEND_IMAGE}:v2"
|
|
|
|
# Tag and push frontend with v2
|
|
echo "📦 Tagging and pushing frontend image..."
|
|
LOCAL_FRONTEND_IMAGE=$(docker images --format "table {{.Repository}}:{{.Tag}}" | grep whoosh.*frontend | head -1)
|
|
if [[ -n "$LOCAL_FRONTEND_IMAGE" ]]; then
|
|
docker tag "$LOCAL_FRONTEND_IMAGE" "${LOCAL_REGISTRY}/${NAMESPACE}/${FRONTEND_IMAGE}:v2"
|
|
fi
|
|
docker push "${LOCAL_REGISTRY}/${NAMESPACE}/${FRONTEND_IMAGE}:v2"
|
|
|
|
echo "✅ Images pushed to local registry successfully!"
|
|
echo "Backend: ${LOCAL_REGISTRY}/${NAMESPACE}/${BACKEND_IMAGE}:v2"
|
|
echo "Frontend: ${LOCAL_REGISTRY}/${NAMESPACE}/${FRONTEND_IMAGE}:v2"
|
|
echo ""
|
|
echo "🔍 Verify images in registry:"
|
|
echo "curl -X GET http://localhost:${REGISTRY_PORT}/v2/${NAMESPACE}/${BACKEND_IMAGE}/tags/list"
|
|
echo "curl -X GET http://localhost:${REGISTRY_PORT}/v2/${NAMESPACE}/${FRONTEND_IMAGE}/tags/list" |