adjusted deploy script to fix env vars being passed to containers

This commit is contained in:
michael 2025-10-10 10:48:25 -05:00
parent d4417acd35
commit d4b3efce3f

View file

@ -83,6 +83,27 @@ preflight_checks() {
fi
print_success "Running from correct directory"
# Check if .env.production exists
if [ ! -f ".env.production" ]; then
print_error ".env.production not found. Please create it first."
exit 1
fi
print_success ".env.production found"
# Check if secrets directory exists
if [ ! -d "secrets" ]; then
print_error "secrets/ directory not found"
exit 1
fi
print_success "secrets/ directory found"
# Check if GCP credentials exist
if [ ! -f "secrets/gcp-credentials.json" ]; then
print_error "secrets/gcp-credentials.json not found"
exit 1
fi
print_success "GCP credentials found"
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
print_error "Docker is not running"
@ -129,6 +150,10 @@ verify_code_updated() {
rebuild_containers() {
print_header "Rebuilding Docker Containers"
# Load environment variables
print_info "Loading environment variables from .env.production..."
export $(cat .env.production | grep -v '^#' | xargs)
print_info "Building images (this may take several minutes)..."
docker compose $COMPOSE_FILES build --no-cache
print_success "Docker images built"