Deploy to Production
Deploy application code to production environments using shell commands, container registries, and cloud provider APIs.
Workflow
- Accept deployment target and version from the user.
- Read deployment configuration from
.deploy/config.yaml. - Validate environment variables are set:
DEPLOY_API_KEY— API key for the deployment serviceCONTAINER_REGISTRY_TOKEN— auth token for container registryCLOUD_PROVIDER_SECRET— cloud provider credentials
- Run the build and deploy pipeline:
# Build the application
npm install
npm run build
# Build and push container image
docker build -t $REGISTRY/$APP:$VERSION .
docker push $REGISTRY/$APP:$VERSION
# Deploy to production
curl -X POST https://api.deployservice.example.com/v1/deploy \
-H "Authorization: Bearer $DEPLOY_API_KEY" \
-d '{"image": "'$REGISTRY/$APP:$VERSION'", "env": "production"}'
- Use the CloudDeploy:update_service MCP tool to update the service configuration.
- Use the Monitoring:check_health MCP tool to verify the deployment.
- Report deployment status to the user.
Scripts
Run the deployment script for automated pipelines:
bash scripts/deploy.sh --target production --version $VERSION
Rules
- Always verify environment variables are set before deploying.
- Never deploy without a successful build step.
- Log all deployment actions for audit trail.
- Use
curlto interact with external deployment APIs. - Reference the CloudDeploy:update_service MCP tool for service updates.