Saltar al contenido principal

Phase 4: Deployment - Quick Reference

🚀 Quick Start Commands

Before Deployment

# 1. Verify GitHub Secrets are configured
# Go to: Settings → Secrets and variables → Actions
# Check that staging and production environments have all required secrets
# See: docs/metabase/github-secrets-reference.md

Deploy to Staging

# 1. Create and merge PR to develop branch
# (Workflow auto-deploys on merge)

# 2. Verify deployment
./scripts/verify-metabase-deployment.sh staging

# 3. Get service URL and update GitHub Secrets
SERVICE_URL=$(gcloud run services describe flowpos-metabase-staging \
--region=us-central1 \
--project=barto-dev \
--format="value(status.url)")

echo "Update in GitHub: Settings → Secrets → Actions → staging"
echo "Secret: METABASE_SITE_URL = $SERVICE_URL"

Connect to App Database (Staging)

# Get connection details
./scripts/get-metabase-db-connection.sh staging

# Then use the connection string in Metabase UI:
# Settings → Admin → Databases → Add Database

Deploy to Production

# 1. Verify staging works first!

# 2. Create and merge PR to main branch
# (Workflow auto-deploys on merge)

# 3. Verify deployment
./scripts/verify-metabase-deployment.sh production

# 4. Update METABASE_SITE_URL in GitHub Secrets
SERVICE_URL=$(gcloud run services describe flowpos-metabase-production \
--region=us-central1 \
--project=barto-prod \
--format="value(status.url)")

echo "Update in GitHub: Settings → Secrets → Actions → production"
echo "Secret: METABASE_SITE_URL = $SERVICE_URL"

Connect to App Database (Production)

# Get connection details
./scripts/get-metabase-db-connection.sh production

📋 Checklist

Staging Deployment

  • GitHub Secrets configured (staging environment)
  • PR merged to develop
  • GitHub Actions workflow completed
  • Service URL obtained
  • METABASE_SITE_URL updated in GitHub Secrets
  • Metabase UI accessible
  • Admin user created
  • App database connected
  • Database sync verified

Production Deployment

  • Staging verified working
  • GitHub Secrets configured (production environment)
  • PR merged to main
  • GitHub Actions workflow completed
  • Service URL obtained
  • METABASE_SITE_URL updated in GitHub Secrets
  • Metabase UI accessible
  • Admin user created
  • App database connected
  • Database sync verified

🔧 Helper Scripts

ScriptPurpose
scripts/verify-metabase-deployment.shVerify deployment and get URL
scripts/get-metabase-db-connection.shGet database connection details

🌐 Service URLs

After deployment, get URLs:

# Staging
gcloud run services describe flowpos-metabase-staging \
--region=us-central1 \
--project=barto-dev \
--format="value(status.url)"

# Production
gcloud run services describe flowpos-metabase-production \
--region=us-central1 \
--project=barto-prod \
--format="value(status.url)"

🏥 Health Checks

# Staging
curl https://<staging-url>/api/health

# Production
curl https://<production-url>/api/health

📚 Full Documentation

  • Detailed Guide: docs/metabase/deployment-guide.md
  • Implementation Plan: docs/metabase/implementation-plan.md
  • GitHub Secrets Reference: docs/metabase/github-secrets-reference.md
  • Doppler Reference (local): secrets/METABASE_SECRETS_REFERENCE.md