#!/bin/bash # Build and push all missing nxtgauge backend services set -e REGISTRY="registry.nxtgauge.com" REGISTRY_USER="admin" REGISTRY_PASS="Ashwin@2026" echo "==================================" echo "Building Nxtgauge Services" echo "==================================" # Login to registry echo "Logging into registry..." echo "$REGISTRY_PASS" | docker login $REGISTRY -u $REGISTRY_USER --password-stdin cd /home/ashwin/nxtgauge-projects/nxtgauge-backend-rust # Get current git SHA for tagging SHA=$(git rev-parse --short HEAD) echo "Building with SHA tag: $SHA" # Services to build SERVICES=( "catering-services" "companies" "cron" "customers" "developers" "employees" "fitness-trainers" "graphic-designers" "job-seekers" "jobs" "leads" "makeup-artists" "payments" "photographers" "social-media-managers" "tutors" "ugc-content-creators" "video-editors" ) # Build each service for service in "${SERVICES[@]}"; do echo "" echo "==================================" echo "Building $service..." echo "==================================" # Build using the service's Dockerfile docker build -f "apps/$service/Dockerfile" \ -t "$REGISTRY/nxtgauge-rust-$service:$SHA" \ -t "$REGISTRY/nxtgauge-rust-$service:latest" \ . 2>&1 || { echo "WARNING: Failed to build $service, continuing..." continue } # Push images echo "Pushing $service:$SHA..." docker push "$REGISTRY/nxtgauge-rust-$service:$SHA" 2>&1 || echo "WARNING: Failed to push $service:$SHA" docker push "$REGISTRY/nxtgauge-rust-$service:latest" 2>&1 || echo "WARNING: Failed to push $service:latest" echo "$service built and pushed successfully!" done echo "" echo "==================================" echo "All services built and pushed!" echo "=================================="