cloudbuild.json
Google Cloud Build configuration file
| Type | object |
|---|---|
| File match |
cloudbuild.json
cloudbuild.yaml
cloudbuild.yml
*.cloudbuild.json
*.cloudbuild.yaml
*.cloudbuild.yml
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/cloudbuild-json/latest.json |
| Source | https://www.schemastore.org/cloudbuild.json |
Validate with Lintel
npx @lintel/lintel check
A build resource in the Cloud Build API.
Properties
Required. The operations to be performed on the workspace.
Google Cloud Storage bucket where logs should be written. See Bucket Name Requirements. Logs file names will be of the format ${logs_bucket}/log-${build_id}.txt.
Tags for organizing and filtering builds.
Substitutions data for Build resource.
A list of images to be pushed upon the successful completion of all build steps. The images are pushed using the builder service account's credentials. The digests of the pushed images will be stored in the Build resource's results field. If any of the images fail to be pushed, the build status is marked FAILURE.
Optional arguments to enable specific features of builds.
14 nested properties
If set to true, automatically map all subsistutions and make them available as environment variables in a single step. If set to false, ignore substitutions for that step. Can be used for a build step or for an entire build.
Compute Engine machine type on which to run the build.
Global list of volumes to mount for ALL build steps. Each volume is created as an empty volume prior to starting the build process. Upon completion of the build, volumes and their contents are discarded. Global volume names and paths cannot conflict with the volumes defined a build step. Using a global volume in a build with only one step is not valid as it is indicative of a build request with an incorrect configuration.
Option to define build log streaming behavior to Google Cloud Storage.
Set the value of this field to the resource name of the private pool to run the build.
1 nested properties
Required. The full resource name of the private pool of the form projects/$PRIVATEPOOL_PROJECT_ID/locations/$REGION/workerPools/$PRIVATEPOOL_ID.
A list of global environment variable definitions that will exist for all build steps in this build.
If a variable is defined both globally and in a build step, the variable will use the build step value. The elements are of the form KEY=VALUE for the environment variable KEY being given the value VALUE.
Option to specify the logging mode, which determines where the logs are stored.
Configure Cloud Build to create a default logs bucket within your own project in the same region as your build.
Requested verifiability options.
Option to specify behavior when there is an error in the substitution checks.
Use this option to explicitly enable or disable bash parameter expansion in substitutions.
If your build is invoked by a trigger, the dynamicSubstitutions field is always set to true and does not need to be specified in your build config file. If your build is invoked manually, you must set the dynamicSubstitutions field to true for bash parameter expansions to be interpreted when running your build.
Requested disk size for the VM that runs the build.
Note that this is NOT "disk free"; some of the space will be used by the operating system and build utilities. Also note that this is the minimum disk size that will be allocated for the build -- the build may run with a larger disk than requested. At present, the maximum disk size is 2000GB; builds that request more than the maximum are rejected with an error.
A list of global environment variables, which are encrypted using a Cloud Key Management Service crypto key. These values must be specified in the build's Secret. These variables will be available to all build steps in this build.
Requested hash for SourceProvenance.
Artifacts produced by a build that should be uploaded upon successful completion of all build steps.
5 nested properties
Files in the workspace to upload to Cloud Storage upon successful completion of all build steps.
2 nested properties
Cloud Storage bucket and optional object path, in the form gs://bucket/path/to/somewhere/. See the Bucket Name Requirements. Files in the workspace matching any path pattern will be uploaded to Cloud Storage with this location as a prefix.
Path globs used to match files in the build's workspace.
Allows you to upload non-container Go modules to Go repositories in Artifact Registry.
Allows you to upload non-container Java artifacts to Maven repositories in Artifact Registry.
Allows you to upload Python packages to Artifact Registry.
Uploads your built NPM packages to supported repositories.
Time limit for executing the build or particular build step. The timeout field of a build step specifies the amount of time the step is allowed to run, and the timeout field of a build specifies the amount of time the build is allowed to run.
Secrets to decrypt using Cloud Key Management Service.
Use this field to specify the IAM service account to use at build time.
Specifies the amount of time a build can be queued. If a build is in the queue for longer than the value set in queueTtl, the build expires and the build status is set to EXPIRED.
Definitions
If set to true, automatically map all subsistutions and make them available as environment variables in a single step. If set to false, ignore substitutions for that step. Can be used for a build step or for an entire build.
truefalse
A step in the build pipeline.
Required. The name of the container image that will run this particular build step. If the image is available in the host's Docker daemon's cache, it will be run directly. If not, the host will attempt to pull the image first, using the builder service account's credentials if necessary.
The Docker daemon's cache will already have the latest versions of all of the officially supported build steps. The Docker daemon will also have cached many of the layers for some popular images, like ubuntu, debian, but they will be refreshed at the time you attempt to use them.
If you built an image in a previous build step, it will be stored in the host's Docker daemon's cache and is available to use as the name for a later build step.
In a build step, if you set the value of the allowFailure field to true, and the build step fails, then the build succeeds as long as all other build steps in that build succeed.
Specify that a build step failure can be ignored when that step returns a particular exit code.
If set to true, automatically map all subsistutions and make them available as environment variables in a single step. If set to false, ignore substitutions for that step. Can be used for a build step or for an entire build.
The id(s) of the step(s) that this build step depends on. This build step will not start until all the build steps in waitFor have completed successfully. If waitFor is empty, this build step will start when all previous build steps in the list have completed successfully. If waitFor is set to '-', the step runs immediately when the build starts.
A list of environment variable definitions to be used when running a step. The elements are of the form KEY=VALUE for the environment variable KEY being given the value VALUE.
Entrypoint to be used instead of the build step image's default entrypoint. If unset, the image's default entrypoint is used.
Specify a shell script to execute in the step. If you specify script in a build step, you cannot specify args or entrypoint in the same step.
List of volumes to mount into the build step. Each volume is created as an empty volume prior to execution of the build step. Upon completion of the build, volumes and their contents are discarded. Using a named volume in only one step is not valid as it is indicative of a build request with an incorrect configuration.
A list of arguments that will be presented to the step when it is started.
If the image used to run the step's container has an entrypoint, the args are used as arguments to that entrypoint. If the image does not define an entrypoint, the first element in args is used as the entrypoint, and the remainder will be used as arguments.
Time limit for executing the build or particular build step. The timeout field of a build step specifies the amount of time the step is allowed to run, and the timeout field of a build specifies the amount of time the build is allowed to run.
Unique identifier for this build step, used in waitFor to reference this build step as a dependency.
A list of environment variables which are encrypted using a Cloud Key Management Service crypto key. These values must be specified in the build's Secret.
Working directory to use when running this step's container.
If this value is a relative path, it is relative to the build's working directory. If this value is absolute, it may be outside the build's working directory, in which case the contents of the path may not be persisted across build step executions, unless a volume for that path is specified. If the build specifies a RepoSource with dir and a step with a dir, which specifies an absolute path, the RepoSource dir is ignored for the step's execution.
Optional arguments to enable specific features of builds.
If set to true, automatically map all subsistutions and make them available as environment variables in a single step. If set to false, ignore substitutions for that step. Can be used for a build step or for an entire build.
Compute Engine machine type on which to run the build.
Global list of volumes to mount for ALL build steps. Each volume is created as an empty volume prior to starting the build process. Upon completion of the build, volumes and their contents are discarded. Global volume names and paths cannot conflict with the volumes defined a build step. Using a global volume in a build with only one step is not valid as it is indicative of a build request with an incorrect configuration.
Option to define build log streaming behavior to Google Cloud Storage.
Set the value of this field to the resource name of the private pool to run the build.
1 nested properties
Required. The full resource name of the private pool of the form projects/$PRIVATEPOOL_PROJECT_ID/locations/$REGION/workerPools/$PRIVATEPOOL_ID.
A list of global environment variable definitions that will exist for all build steps in this build.
If a variable is defined both globally and in a build step, the variable will use the build step value. The elements are of the form KEY=VALUE for the environment variable KEY being given the value VALUE.
Option to specify the logging mode, which determines where the logs are stored.
Configure Cloud Build to create a default logs bucket within your own project in the same region as your build.
Requested verifiability options.
Option to specify behavior when there is an error in the substitution checks.
Use this option to explicitly enable or disable bash parameter expansion in substitutions.
If your build is invoked by a trigger, the dynamicSubstitutions field is always set to true and does not need to be specified in your build config file. If your build is invoked manually, you must set the dynamicSubstitutions field to true for bash parameter expansions to be interpreted when running your build.
Requested disk size for the VM that runs the build.
Note that this is NOT "disk free"; some of the space will be used by the operating system and build utilities. Also note that this is the minimum disk size that will be allocated for the build -- the build may run with a larger disk than requested. At present, the maximum disk size is 2000GB; builds that request more than the maximum are rejected with an error.
A list of global environment variables, which are encrypted using a Cloud Key Management Service crypto key. These values must be specified in the build's Secret. These variables will be available to all build steps in this build.
Requested hash for SourceProvenance.
Pairs a set of secret environment variables containing encrypted values with the Cloud KMS key to use to decrypt the value.
Cloud KMS key name to use to decrypt these envs.
Map of environment variable name to its encrypted value. Secret environment variables must be unique across all of a build's secrets, and must be used by at least one build step. Values can be at most 64 KB in size. There can be at most 100 secret values across all of a build's secrets.
Artifacts produced by a build that should be uploaded upon successful completion of all build steps.
Files in the workspace to upload to Cloud Storage upon successful completion of all build steps.
2 nested properties
Cloud Storage bucket and optional object path, in the form gs://bucket/path/to/somewhere/. See the Bucket Name Requirements. Files in the workspace matching any path pattern will be uploaded to Cloud Storage with this location as a prefix.
Path globs used to match files in the build's workspace.
Allows you to upload non-container Go modules to Go repositories in Artifact Registry.
Allows you to upload non-container Java artifacts to Maven repositories in Artifact Registry.
Allows you to upload Python packages to Artifact Registry.
Uploads your built NPM packages to supported repositories.
Files in the workspace to upload to Cloud Storage upon successful completion of all build steps.
Cloud Storage bucket and optional object path, in the form gs://bucket/path/to/somewhere/. See the Bucket Name Requirements. Files in the workspace matching any path pattern will be uploaded to Cloud Storage with this location as a prefix.
Path globs used to match files in the build's workspace.
Allows you to upload non-container Go modules to Go repositories in Artifact Registry.
The name of your Go repository in Artifact Registry.
The location for your repository in Artifact Registry.
The ID of the Google Cloud project that contains your Artifact Registry Go repository.
The path to the go.mod file in the build's workspace.
The local directory that contains the Go module to upload. It is recommended to use an absolute path for the value.
The version of the Go module.
Allows you to upload non-container Java artifacts to Maven repositories in Artifact Registry.
Required. Name of the Artifact Registry repository to store Java artifacts.
Required. The application file path.
Required. Name of your package file created from your build step
Required. Uniquely identifies your project across all Maven projects, in the format com.mycompany.app.
Required. The version number for your application.
Allows you to upload Python packages to Artifact Registry.
Required. Name of the Artifact Registry repository to store the Python package.
Required. The package file paths.
Uploads your built NPM packages to supported repositories.
Required. Name of the Artifact Registry repository to store the NPM package.
Required. The path for the local directory containing the NPM package that you want to upload to Artifact Registry. Google recommends using an absolute path. Your packagePath value can be . to use the current working directory, but the field cannot be omitted or left empty. This directory must contain a package.json file.
Volume describes a Docker container volume which is mounted into build steps in order to persist files across build step execution.
Name of the volume to mount. Volume names must be unique per build step and must be valid names for Docker volumes. Each named volume must be used by at least two build steps.
Path at which to mount the volume. Paths must be absolute and cannot conflict with other volume paths on the same build step or with certain reserved volume paths.
Time limit for executing the build or particular build step. The timeout field of a build step specifies the amount of time the step is allowed to run, and the timeout field of a build specifies the amount of time the build is allowed to run.
"3.5s""120s"