- Add VPC connector and egress config for VM access - Add infrastructure env vars (Redis, Qdrant, Celery, DB placeholder) - Add Secret Manager references for sensitive values - Expose Qdrant port on VM IP for Cloud Run worker access Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
58 lines
2.1 KiB
YAML
58 lines
2.1 KiB
YAML
steps:
|
|
# Build worker image
|
|
- name: 'gcr.io/cloud-builders/docker'
|
|
args:
|
|
- 'build'
|
|
- '-t'
|
|
- 'europe-west1-docker.pkg.dev/$PROJECT_ID/nexus/nexus-worker:$COMMIT_SHA'
|
|
- '-t'
|
|
- 'europe-west1-docker.pkg.dev/$PROJECT_ID/nexus/nexus-worker:latest'
|
|
- '-f'
|
|
- 'backend/Dockerfile.worker'
|
|
- 'backend'
|
|
|
|
# Push to Artifact Registry
|
|
- name: 'gcr.io/cloud-builders/docker'
|
|
args:
|
|
- 'push'
|
|
- '--all-tags'
|
|
- 'europe-west1-docker.pkg.dev/$PROJECT_ID/nexus/nexus-worker'
|
|
|
|
# Deploy to Cloud Run
|
|
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
|
|
entrypoint: 'gcloud'
|
|
args:
|
|
- 'run'
|
|
- 'deploy'
|
|
- 'nexus-worker'
|
|
- '--image'
|
|
- 'europe-west1-docker.pkg.dev/$PROJECT_ID/nexus/nexus-worker:$COMMIT_SHA'
|
|
- '--region'
|
|
- 'europe-west1'
|
|
- '--no-allow-unauthenticated'
|
|
- '--min-instances'
|
|
- '0'
|
|
- '--max-instances'
|
|
- '3'
|
|
- '--memory'
|
|
- '2Gi'
|
|
- '--cpu'
|
|
- '2'
|
|
- '--timeout'
|
|
- '1800'
|
|
- '--no-cpu-throttling'
|
|
- '--vpc-connector'
|
|
- 'projects/optical-414516/locations/europe-west1/connectors/nexus-vpc'
|
|
- '--vpc-egress'
|
|
- 'private-ranges-only'
|
|
- '--set-env-vars'
|
|
- 'ENVIRONMENT=production,DATABASE_URL=postgresql://nexus_user:PLACEHOLDER@10.220.168.5:15432/nexus_db,REDIS_URL=redis://10.220.168.5:16379/0,CELERY_BROKER_URL=redis://10.220.168.5:16379/0,CELERY_RESULT_BACKEND=redis://10.220.168.5:16379/0,QDRANT_URL=http://10.220.168.5:6333,SHAREPOINT_TENANT_DOMAIN=company.sharepoint.com'
|
|
- '--set-secrets'
|
|
- 'DATABASE_URL=nexus-database-url:latest,OPENAI_API_KEY=nexus-openai-api-key:latest,ANTHROPIC_API_KEY=nexus-anthropic-api-key:latest,GOOGLE_API_KEY=nexus-google-api-key:latest,JWT_SECRET=nexus-jwt-secret:latest,ENTRA_CLIENT_ID=nexus-entra-client-id:latest,ENTRA_TENANT_ID=nexus-entra-tenant-id:latest,LLAMAPARSE_API_KEY=nexus-llamaparse-api-key:latest'
|
|
|
|
images:
|
|
- 'europe-west1-docker.pkg.dev/$PROJECT_ID/nexus/nexus-worker:$COMMIT_SHA'
|
|
- 'europe-west1-docker.pkg.dev/$PROJECT_ID/nexus/nexus-worker:latest'
|
|
|
|
options:
|
|
logging: CLOUD_LOGGING_ONLY
|