Cloud Build

Definition

Cloud Build is a continuous integration and delivery (CI/CD) service provided by Google Cloud Platform (GCP) that automates the process of building, testing, and deploying applications. It allows developers to define build steps in a configuration file, which can be executed in a secure and scalable environment. Cloud Build supports multiple environments and languages, enabling integration with various source repositories and deployment targets.

Secure Settings Example

steps:
- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '-t', 'gcr.io/my-project/my-image:$COMMIT_SHA', '.']
  entrypoint: 'bash'
  env:
    - 'CLOUDSDK_COMPUTE_ZONE=us-central1-a'
options:
  logging: CLOUD_LOGGING_ONLY
  machineType: 'E2_HIGHCPU_8'
timeout: '1200s'
artifacts:
  objects:
    location: 'gs://my-project-artifacts/$COMMIT_SHA/'
    paths: ['**']

Insecure Settings Example

steps:
- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '-t', 'gcr.io/my-project/my-image', '.']
  env:
    - 'CLOUDSDK_COMPUTE_ZONE=us-central1-a'
options:
  logging: NONE
timeout: '3600s'
artifacts:
  objects:
    location: 'gs://my-project-artifacts/'
    paths: ['**']