con un clic
cloud-build-helper
Configures Google Cloud Build pipelines with caching, parallel builds, and optimization. Use when setting up Cloud Build, optimizing build performance, or configuring CI/CD pipelines.
Menú
Configures Google Cloud Build pipelines with caching, parallel builds, and optimization. Use when setting up Cloud Build, optimizing build performance, or configuring CI/CD pipelines.
| name | cloud-build-helper |
| description | Configures Google Cloud Build pipelines with caching, parallel builds, and optimization. Use when setting up Cloud Build, optimizing build performance, or configuring CI/CD pipelines. |
Configure Cloud Build pipelines with proper caching and optimization for fast, efficient builds.
steps:
# Build step
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/myapp:$COMMIT_SHA', '.']
# Push to registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/myapp:$COMMIT_SHA']
# Deploy
- name: 'gcr.io/cloud-builders/gcloud'
args:
- 'run'
- 'deploy'
- 'myapp'
- '--image=gcr.io/$PROJECT_ID/myapp:$COMMIT_SHA'
- '--region=us-central1'
images:
- 'gcr.io/$PROJECT_ID/myapp:$COMMIT_SHA'
options:
machineType: 'N1_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
steps:
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
docker pull gcr.io/$PROJECT_ID/myapp:latest || exit 0
docker build \
--cache-from gcr.io/$PROJECT_ID/myapp:latest \
-t gcr.io/$PROJECT_ID/myapp:$COMMIT_SHA \
-t gcr.io/$PROJECT_ID/myapp:latest \
.
docker push gcr.io/$PROJECT_ID/myapp:$COMMIT_SHA
docker push gcr.io/$PROJECT_ID/myapp:latest
# Create trigger from GitHub
gcloud builds triggers create github \
--repo-name=my-repo \
--repo-owner=my-org \
--branch-pattern="^main$" \
--build-config=cloudbuild.yaml
# Create trigger with substitutions
gcloud builds triggers create github \
--repo-name=my-repo \
--repo-owner=my-org \
--branch-pattern="^main$" \
--build-config=cloudbuild.yaml \
--substitutions=_ENV=production,_REGION=us-central1
Use parallel steps:
steps:
# These run in parallel
- name: 'gcr.io/cloud-builders/npm'
id: 'install-frontend'
args: ['install']
dir: 'frontend'
waitFor: ['-']
- name: 'gcr.io/cloud-builders/npm'
id: 'install-backend'
args: ['install']
dir: 'backend'
waitFor: ['-']
# This waits for both
- name: 'gcr.io/cloud-builders/npm'
args: ['run', 'build']
waitFor: ['install-frontend', 'install-backend']
For detailed information, see:
Creates and validates Azure Resource Manager (ARM) templates for infrastructure deployment. Use when creating ARM templates, deploying Azure infrastructure as code, or validating Azure templates.
Analyzes Azure costs and provides optimization recommendations including reserved instances, rightsizing, and unused resources. Use when optimizing Azure spending or analyzing Azure costs.
Creates dbt models with proper layering (staging, marts), incremental strategies, and documentation. Use when creating dbt models, organizing data transformations, or implementing incremental models.
Generates dbt tests including schema tests, data quality tests, and freshness checks. Use when adding tests to dbt models or implementing data quality validation.
Analyzes GCP costs and provides optimization recommendations including committed use discounts, rightsizing, and unused resources. Use when optimizing GCP spending or analyzing GCP costs.
Create custom GitHub Actions (composite, Docker, or JavaScript). Use when building reusable actions, creating custom workflow steps, or packaging logic for distribution. Trigger words include "create action", "custom action", "build action", "composite action", "Docker action".