cloudbuild.yamlā¢1.91 kB
# Cloud Build configuration for automated deployment
# This file is used by Google Cloud Build to build and deploy the MCP server
steps:
# Step 1: Build the container image
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-t'
- 'gcr.io/$PROJECT_ID/finizi-b4b-mcp:$COMMIT_SHA'
- '-t'
- 'gcr.io/$PROJECT_ID/finizi-b4b-mcp:latest'
- '.'
# Step 2: Push the container image to Google Container Registry
- name: 'gcr.io/cloud-builders/docker'
args:
- 'push'
- 'gcr.io/$PROJECT_ID/finizi-b4b-mcp:$COMMIT_SHA'
# Step 3: Push latest tag
- name: 'gcr.io/cloud-builders/docker'
args:
- 'push'
- 'gcr.io/$PROJECT_ID/finizi-b4b-mcp:latest'
# Step 4: Deploy to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'finizi-b4b-mcp'
- '--image'
- 'gcr.io/$PROJECT_ID/finizi-b4b-mcp:$COMMIT_SHA'
- '--region'
- '${_REGION}'
- '--platform'
- 'managed'
- '--allow-unauthenticated'
- '--max-instances'
- '10'
- '--min-instances'
- '0'
- '--memory'
- '512Mi'
- '--cpu'
- '1'
- '--timeout'
- '60s'
- '--set-env-vars'
- 'B4B_API_BASE_URL=${_B4B_API_BASE_URL},LOG_LEVEL=${_LOG_LEVEL}'
# Store images in Google Container Registry
images:
- 'gcr.io/$PROJECT_ID/finizi-b4b-mcp:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/finizi-b4b-mcp:latest'
# Build timeout
timeout: '1200s'
# Substitution variables (can be overridden during build)
substitutions:
_REGION: 'us-central1'
_B4B_API_BASE_URL: 'https://your-b4b-api.example.com'
_LOG_LEVEL: 'INFO'
options:
# Use the latest machine type for faster builds
machineType: 'N1_HIGHCPU_8'
# Enable faster Docker builds
substitution_option: 'ALLOW_LOOSE'
logging: CLOUD_LOGGING_ONLY