### antes de 20260412 
# crname=projects
# docker build -t gcr.io/mt-api-gateway-390018/$crname-cloudrun:latest .
# docker push gcr.io/mt-api-gateway-390018/$crname-cloudrun:latest
# gcloud run deploy $crname-cloudrun --image="gcr.io/mt-api-gateway-390018/$crname-cloudrun:latest" --timeout=10m --region=us-central1

crname=projects
# 1. Build with --no-cache to ensure your 'COPY .' actually picks up new files
docker build --no-cache -t gcr.io/mt-api-gateway-390018/$crname-cloudrun:latest .

# 2. Re-run the push and WAIT to ensure it finishes 100%
docker push gcr.io/mt-api-gateway-390018/$crname-cloudrun:latest

# 3. Only deploy if the push was successful
if [ $? -eq 0 ]; then
  gcloud run deploy $crname-cloudrun \
    --image="gcr.io/mt-api-gateway-390018/$crname-cloudrun:latest" \
    --timeout=10m \
    --region=us-central1
else
  echo "Push failed! Check your connection to gcr.io"
fi