@googleapis/cloudbuild
Version:
1,177 lines (1,168 loc) • 508 kB
text/typescript
// Copyright 2020 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-interface */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable no-irregular-whitespace */
import {
OAuth2Client,
JWT,
Compute,
UserRefreshClient,
BaseExternalAccountClient,
GaxiosResponseWithHTTP2,
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
GoogleAuth,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';
export namespace cloudbuild_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?:
| string
| OAuth2Client
| JWT
| Compute
| UserRefreshClient
| BaseExternalAccountClient
| GoogleAuth;
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* Cloud Build API
*
* Creates and manages builds on Google Cloud Platform.
*
* @example
* ```js
* const {google} = require('googleapis');
* const cloudbuild = google.cloudbuild('v1');
* ```
*/
export class Cloudbuild {
context: APIRequestContext;
githubDotComWebhook: Resource$Githubdotcomwebhook;
locations: Resource$Locations;
operations: Resource$Operations;
projects: Resource$Projects;
v1: Resource$V1;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this.context = {
_options: options || {},
google,
};
this.githubDotComWebhook = new Resource$Githubdotcomwebhook(this.context);
this.locations = new Resource$Locations(this.context);
this.operations = new Resource$Operations(this.context);
this.projects = new Resource$Projects(this.context);
this.v1 = new Resource$V1(this.context);
}
}
/**
* ApprovalConfig describes configuration for manual approval of a build.
*/
export interface Schema$ApprovalConfig {
/**
* Whether or not approval is needed. If this is set on a build, it will become pending when created, and will need to be explicitly approved to start.
*/
approvalRequired?: boolean | null;
}
/**
* ApprovalResult describes the decision and associated metadata of a manual approval of a build.
*/
export interface Schema$ApprovalResult {
/**
* Output only. The time when the approval decision was made.
*/
approvalTime?: string | null;
/**
* Output only. Email of the user that called the ApproveBuild API to approve or reject a build at the time that the API was called.
*/
approverAccount?: string | null;
/**
* Optional. An optional comment for this manual approval result.
*/
comment?: string | null;
/**
* Required. The decision of this manual approval.
*/
decision?: string | null;
/**
* Optional. An optional URL tied to this manual approval result. This field is essentially the same as comment, except that it will be rendered by the UI differently. An example use case is a link to an external job that approved this Build.
*/
url?: string | null;
}
/**
* Request to approve or reject a pending build.
*/
export interface Schema$ApproveBuildRequest {
/**
* Approval decision and metadata.
*/
approvalResult?: Schema$ApprovalResult;
}
/**
* Files in the workspace to upload to Cloud Storage upon successful completion of all build steps.
*/
export interface Schema$ArtifactObjects {
/**
* Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/". (see [Bucket Name Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). Files in the workspace matching any path pattern will be uploaded to Cloud Storage with this location as a prefix.
*/
location?: string | null;
/**
* Path globs used to match files in the build's workspace.
*/
paths?: string[] | null;
/**
* Output only. Stores timing information for pushing all artifact objects.
*/
timing?: Schema$TimeSpan;
}
/**
* An artifact that was uploaded during a build. This is a single record in the artifact manifest JSON file.
*/
export interface Schema$ArtifactResult {
/**
* The file hash of the artifact.
*/
fileHash?: Schema$FileHashes[];
/**
* The path of an artifact in a Cloud Storage bucket, with the generation number. For example, `gs://mybucket/path/to/output.jar#generation`.
*/
location?: string | null;
}
/**
* Artifacts produced by a build that should be uploaded upon successful completion of all build steps.
*/
export interface Schema$Artifacts {
/**
* Optional. A list of Go modules to be uploaded to Artifact Registry upon successful completion of all build steps. If any objects fail to be pushed, the build is marked FAILURE.
*/
goModules?: Schema$GoModule[];
/**
* A list of images to be pushed upon the successful completion of all build steps. The images will be 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 is marked FAILURE.
*/
images?: string[] | null;
/**
* A list of Maven artifacts to be uploaded to Artifact Registry upon successful completion of all build steps. Artifacts in the workspace matching specified paths globs will be uploaded to the specified Artifact Registry repository using the builder service account's credentials. If any artifacts fail to be pushed, the build is marked FAILURE.
*/
mavenArtifacts?: Schema$MavenArtifact[];
/**
* A list of npm packages to be uploaded to Artifact Registry upon successful completion of all build steps. Npm packages in the specified paths will be uploaded to the specified Artifact Registry repository using the builder service account's credentials. If any packages fail to be pushed, the build is marked FAILURE.
*/
npmPackages?: Schema$NpmPackage[];
/**
* A list of objects to be uploaded to Cloud Storage upon successful completion of all build steps. Files in the workspace matching specified paths globs will be uploaded to the specified Cloud Storage location using the builder service account's credentials. The location and generation of the uploaded objects will be stored in the Build resource's results field. If any objects fail to be pushed, the build is marked FAILURE.
*/
objects?: Schema$ArtifactObjects;
/**
* A list of Python packages to be uploaded to Artifact Registry upon successful completion of all build steps. The build service account credentials will be used to perform the upload. If any objects fail to be pushed, the build is marked FAILURE.
*/
pythonPackages?: Schema$PythonPackage[];
}
/**
* RPC request object accepted by BatchCreateBitbucketServerConnectedRepositories RPC method.
*/
export interface Schema$BatchCreateBitbucketServerConnectedRepositoriesRequest {
/**
* Required. Requests to connect Bitbucket Server repositories.
*/
requests?: Schema$CreateBitbucketServerConnectedRepositoryRequest[];
}
/**
* Response of BatchCreateBitbucketServerConnectedRepositories RPC method including all successfully connected Bitbucket Server repositories.
*/
export interface Schema$BatchCreateBitbucketServerConnectedRepositoriesResponse {
/**
* The connected Bitbucket Server repositories.
*/
bitbucketServerConnectedRepositories?: Schema$BitbucketServerConnectedRepository[];
}
/**
* Metadata for `BatchCreateBitbucketServerConnectedRepositories` operation.
*/
export interface Schema$BatchCreateBitbucketServerConnectedRepositoriesResponseMetadata {
/**
* Time the operation was completed.
*/
completeTime?: string | null;
/**
* The name of the `BitbucketServerConfig` that added connected repositories. Format: `projects/{project\}/locations/{location\}/bitbucketServerConfigs/{config\}`
*/
config?: string | null;
/**
* Time the operation was created.
*/
createTime?: string | null;
}
/**
* RPC request object accepted by BatchCreateGitLabConnectedRepositories RPC method.
*/
export interface Schema$BatchCreateGitLabConnectedRepositoriesRequest {
/**
* Required. Requests to connect GitLab repositories.
*/
requests?: Schema$CreateGitLabConnectedRepositoryRequest[];
}
/**
* Response of BatchCreateGitLabConnectedRepositories RPC method.
*/
export interface Schema$BatchCreateGitLabConnectedRepositoriesResponse {
/**
* The GitLab connected repository requests' responses.
*/
gitlabConnectedRepositories?: Schema$GitLabConnectedRepository[];
}
/**
* Metadata for `BatchCreateGitLabConnectedRepositories` operation.
*/
export interface Schema$BatchCreateGitLabConnectedRepositoriesResponseMetadata {
/**
* Time the operation was completed.
*/
completeTime?: string | null;
/**
* The name of the `GitLabConfig` that added connected repositories. Format: `projects/{project\}/locations/{location\}/gitLabConfigs/{config\}`
*/
config?: string | null;
/**
* Time the operation was created.
*/
createTime?: string | null;
}
/**
* BitbucketServerConfig represents the configuration for a Bitbucket Server.
*/
export interface Schema$BitbucketServerConfig {
/**
* Required. Immutable. API Key that will be attached to webhook. Once this field has been set, it cannot be changed. If you need to change it, please create another BitbucketServerConfig.
*/
apiKey?: string | null;
/**
* Output only. Connected Bitbucket Server repositories for this config.
*/
connectedRepositories?: Schema$BitbucketServerRepositoryId[];
/**
* Time when the config was created.
*/
createTime?: string | null;
/**
* Required. Immutable. The URI of the Bitbucket Server host. Once this field has been set, it cannot be changed. If you need to change it, please create another BitbucketServerConfig.
*/
hostUri?: string | null;
/**
* The resource name for the config.
*/
name?: string | null;
/**
* Optional. The network to be used when reaching out to the Bitbucket Server instance. The VPC network must be enabled for private service connection. This should be set if the Bitbucket Server instance is hosted on-premises and not reachable by public internet. If this field is left empty, no network peering will occur and calls to the Bitbucket Server instance will be made over the public internet. Must be in the format `projects/{project\}/global/networks/{network\}`, where {project\} is a project number or id and {network\} is the name of a VPC network in the project.
*/
peeredNetwork?: string | null;
/**
* Immutable. IP range within the peered network. This is specified in CIDR notation with a slash and the subnet prefix size. You can optionally specify an IP address before the subnet prefix value. e.g. `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a 29 bit prefix size. `/16` would specify a prefix size of 16 bits, with an automatically determined IP within the peered VPC. If unspecified, a value of `/24` will be used. The field only has an effect if peered_network is set.
*/
peeredNetworkIpRange?: string | null;
/**
* Required. Secret Manager secrets needed by the config.
*/
secrets?: Schema$BitbucketServerSecrets;
/**
* Optional. SSL certificate to use for requests to Bitbucket Server. The format should be PEM format but the extension can be one of .pem, .cer, or .crt.
*/
sslCa?: string | null;
/**
* Username of the account Cloud Build will use on Bitbucket Server.
*/
username?: string | null;
/**
* Output only. UUID included in webhook requests. The UUID is used to look up the corresponding config.
*/
webhookKey?: string | null;
}
/**
* / BitbucketServerConnectedRepository represents a connected Bitbucket Server / repository.
*/
export interface Schema$BitbucketServerConnectedRepository {
/**
* The name of the `BitbucketServerConfig` that added connected repository. Format: `projects/{project\}/locations/{location\}/bitbucketServerConfigs/{config\}`
*/
parent?: string | null;
/**
* The Bitbucket Server repositories to connect.
*/
repo?: Schema$BitbucketServerRepositoryId;
/**
* Output only. The status of the repo connection request.
*/
status?: Schema$Status;
}
/**
* BitbucketServerRepository represents a repository hosted on a Bitbucket Server.
*/
export interface Schema$BitbucketServerRepository {
/**
* Link to the browse repo page on the Bitbucket Server instance.
*/
browseUri?: string | null;
/**
* Description of the repository.
*/
description?: string | null;
/**
* Display name of the repository.
*/
displayName?: string | null;
/**
* The resource name of the repository.
*/
name?: string | null;
/**
* Identifier for a repository hosted on a Bitbucket Server.
*/
repoId?: Schema$BitbucketServerRepositoryId;
}
/**
* BitbucketServerRepositoryId identifies a specific repository hosted on a Bitbucket Server.
*/
export interface Schema$BitbucketServerRepositoryId {
/**
* Required. Identifier for the project storing the repository.
*/
projectKey?: string | null;
/**
* Required. Identifier for the repository.
*/
repoSlug?: string | null;
/**
* Output only. The ID of the webhook that was created for receiving events from this repo. We only create and manage a single webhook for each repo.
*/
webhookId?: number | null;
}
/**
* BitbucketServerSecrets represents the secrets in Secret Manager for a Bitbucket Server.
*/
export interface Schema$BitbucketServerSecrets {
/**
* Required. The resource name for the admin access token's secret version.
*/
adminAccessTokenVersionName?: string | null;
/**
* Required. The resource name for the read access token's secret version.
*/
readAccessTokenVersionName?: string | null;
/**
* Required. Immutable. The resource name for the webhook secret's secret version. Once this field has been set, it cannot be changed. If you need to change it, please create another BitbucketServerConfig.
*/
webhookSecretVersionName?: string | null;
}
/**
* BitbucketServerTriggerConfig describes the configuration of a trigger that creates a build whenever a Bitbucket Server event is received.
*/
export interface Schema$BitbucketServerTriggerConfig {
/**
* Output only. The BitbucketServerConfig specified in the bitbucket_server_config_resource field.
*/
bitbucketServerConfig?: Schema$BitbucketServerConfig;
/**
* Required. The Bitbucket server config resource that this trigger config maps to.
*/
bitbucketServerConfigResource?: string | null;
/**
* Required. Key of the project that the repo is in. For example: The key for https://mybitbucket.server/projects/TEST/repos/test-repo is "TEST".
*/
projectKey?: string | null;
/**
* Filter to match changes in pull requests.
*/
pullRequest?: Schema$PullRequestFilter;
/**
* Filter to match changes in refs like branches, tags.
*/
push?: Schema$PushFilter;
/**
* Required. Slug of the repository. A repository slug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL. For example, if the repository name is 'test repo', in the URL it would become 'test-repo' as in https://mybitbucket.server/projects/TEST/repos/test-repo.
*/
repoSlug?: string | null;
}
/**
* A build resource in the Cloud Build API. At a high level, a `Build` describes where to find source code, how to build it (for example, the builder image to run on the source), and where to store the built artifacts. Fields can include the following variables, which will be expanded when the build is created: - $PROJECT_ID: the project ID of the build. - $PROJECT_NUMBER: the project number of the build. - $LOCATION: the location/region of the build. - $BUILD_ID: the autogenerated ID of the build. - $REPO_NAME: the source repository name specified by RepoSource. - $BRANCH_NAME: the branch name specified by RepoSource. - $TAG_NAME: the tag name specified by RepoSource. - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or resolved from the specified branch or tag. - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA.
*/
export interface Schema$Build {
/**
* Output only. Describes this build's approval configuration, status, and result.
*/
approval?: Schema$BuildApproval;
/**
* Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
*/
artifacts?: Schema$Artifacts;
/**
* Secrets and secret environment variables.
*/
availableSecrets?: Schema$Secrets;
/**
* Output only. The ID of the `BuildTrigger` that triggered this build, if it was triggered automatically.
*/
buildTriggerId?: string | null;
/**
* Output only. Time at which the request to create the build was received.
*/
createTime?: string | null;
/**
* Optional. Dependencies that the Cloud Build worker will fetch before executing user steps.
*/
dependencies?: Schema$Dependency[];
/**
* Output only. Contains information about the build when status=FAILURE.
*/
failureInfo?: Schema$FailureInfo;
/**
* Output only. Time at which execution of the build was finished. The difference between finish_time and start_time is the duration of the build's execution.
*/
finishTime?: string | null;
/**
* Optional. Configuration for git operations.
*/
gitConfig?: Schema$GitConfig;
/**
* Output only. Unique identifier of the build.
*/
id?: string | null;
/**
* 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`.
*/
images?: string[] | null;
/**
* Cloud Storage bucket where logs should be written (see [Bucket Name Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). Logs file names will be of the format `${logs_bucket\}/log-${build_id\}.txt`.
*/
logsBucket?: string | null;
/**
* Output only. URL to logs for this build in Google Cloud Console.
*/
logUrl?: string | null;
/**
* Output only. The 'Build' name with format: `projects/{project\}/locations/{location\}/builds/{build\}`, where {build\} is a unique identifier generated by the service.
*/
name?: string | null;
/**
* Special options for this build.
*/
options?: Schema$BuildOptions;
/**
* Output only. ID of the project.
*/
projectId?: string | null;
/**
* TTL in queue for this build. If provided and the build is enqueued longer than this value, the build will expire and the build status will be `EXPIRED`. The TTL starts ticking from create_time.
*/
queueTtl?: string | null;
/**
* Output only. Results of the build.
*/
results?: Schema$Results;
/**
* Secrets to decrypt using Cloud Key Management Service. Note: Secret Manager is the recommended technique for managing sensitive data with Cloud Build. Use `available_secrets` to configure builds to access secrets from Secret Manager. For instructions, see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets
*/
secrets?: Schema$Secret[];
/**
* IAM service account whose credentials will be used at build runtime. Must be of the format `projects/{PROJECT_ID\}/serviceAccounts/{ACCOUNT\}`. ACCOUNT can be email address or uniqueId of the service account.
*/
serviceAccount?: string | null;
/**
* Optional. The location of the source files to build.
*/
source?: Schema$Source;
/**
* Output only. A permanent fixed identifier for source.
*/
sourceProvenance?: Schema$SourceProvenance;
/**
* Output only. Time at which execution of the build was started.
*/
startTime?: string | null;
/**
* Output only. Status of the build.
*/
status?: string | null;
/**
* Output only. Customer-readable message about the current status.
*/
statusDetail?: string | null;
/**
* Required. The operations to be performed on the workspace.
*/
steps?: Schema$BuildStep[];
/**
* Substitutions data for `Build` resource.
*/
substitutions?: {[key: string]: string} | null;
/**
* Tags for annotation of a `Build`. These are not docker tags.
*/
tags?: string[] | null;
/**
* Amount of time that this build should be allowed to run, to second granularity. If this amount of time elapses, work on the build will cease and the build status will be `TIMEOUT`. `timeout` starts ticking from `startTime`. Default time is 60 minutes.
*/
timeout?: string | null;
/**
* Output only. Stores timing information for phases of the build. Valid keys are: * BUILD: time to execute all build steps. * PUSH: time to push all artifacts including docker images and non docker artifacts. * FETCHSOURCE: time to fetch source. * SETUPBUILD: time to set up build. If the build does not specify source or images, these keys will not be included.
*/
timing?: {[key: string]: Schema$TimeSpan} | null;
/**
* Output only. Non-fatal problems encountered during the execution of the build.
*/
warnings?: Schema$Warning[];
}
/**
* BuildApproval describes a build's approval configuration, state, and result.
*/
export interface Schema$BuildApproval {
/**
* Output only. Configuration for manual approval of this build.
*/
config?: Schema$ApprovalConfig;
/**
* Output only. Result of manual approval for this Build.
*/
result?: Schema$ApprovalResult;
/**
* Output only. The state of this build's approval.
*/
state?: string | null;
}
/**
* Metadata for build operations.
*/
export interface Schema$BuildOperationMetadata {
/**
* The build that the operation is tracking.
*/
build?: Schema$Build;
}
/**
* Optional arguments to enable specific features of builds.
*/
export interface Schema$BuildOptions {
/**
* Option to include built-in and custom substitutions as env variables for all build steps.
*/
automapSubstitutions?: boolean | null;
/**
* Optional. Option to specify how default logs buckets are setup.
*/
defaultLogsBucketBehavior?: string | null;
/**
* 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 4000GB; builds that request more than the maximum are rejected with an error.
*/
diskSizeGb?: string | null;
/**
* Option to specify whether or not to apply bash style string operations to the substitutions. NOTE: this is always enabled for triggered builds and cannot be overridden in the build configuration file.
*/
dynamicSubstitutions?: boolean | null;
/**
* Optional. Option to specify whether structured logging is enabled. If true, JSON-formatted logs are parsed as structured logs.
*/
enableStructuredLogging?: boolean | null;
/**
* A list of global environment variable definitions that will exist for all build steps in this build. If a variable is defined in 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".
*/
env?: string[] | null;
/**
* Option to specify the logging mode, which determines if and where build logs are stored.
*/
logging?: string | null;
/**
* Option to define build log streaming behavior to Cloud Storage.
*/
logStreamingOption?: string | null;
/**
* Compute Engine machine type on which to run the build.
*/
machineType?: string | null;
/**
* Optional. Specification for execution on a `WorkerPool`. See [running builds in a private pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) for more information.
*/
pool?: Schema$PoolOption;
/**
* Optional. Option to specify the Pub/Sub topic to receive build status updates.
*/
pubsubTopic?: string | null;
/**
* Requested verifiability options.
*/
requestedVerifyOption?: string | null;
/**
* 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.
*/
secretEnv?: string[] | null;
/**
* Requested hash for SourceProvenance.
*/
sourceProvenanceHash?: string[] | null;
/**
* Option to specify behavior when there is an error in the substitution checks. NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot be overridden in the build configuration file.
*/
substitutionOption?: string | null;
/**
* 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.
*/
volumes?: Schema$Volume[];
/**
* This field deprecated; please use `pool.name` instead.
*/
workerPool?: string | null;
}
/**
* A step in the build pipeline.
*/
export interface Schema$BuildStep {
/**
* Allow this build step to fail without failing the entire build if and only if the exit code is one of the specified codes. If allow_failure is also specified, this field will take precedence.
*/
allowExitCodes?: number[] | null;
/**
* Allow this build step to fail without failing the entire build. If false, the entire build will fail if this step fails. Otherwise, the build will succeed, but this step will still have a failure status. Error information will be reported in the failure_detail field.
*/
allowFailure?: boolean | null;
/**
* 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.
*/
args?: string[] | null;
/**
* Option to include built-in and custom substitutions as env variables for this build step. This option will override the global option in BuildOption.
*/
automapSubstitutions?: boolean | null;
/**
* 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.
*/
dir?: string | null;
/**
* Entrypoint to be used instead of the build step image's default entrypoint. If unset, the image's default entrypoint is used.
*/
entrypoint?: string | null;
/**
* 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".
*/
env?: string[] | null;
/**
* Output only. Return code from running the step.
*/
exitCode?: number | null;
/**
* Unique identifier for this build step, used in `wait_for` to reference this build step as a dependency.
*/
id?: string | null;
/**
* 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 ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). 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.
*/
name?: string | null;
/**
* Output only. Stores timing information for pulling this build step's builder image only.
*/
pullTiming?: Schema$TimeSpan;
/**
* A shell script to be executed in the step. When script is provided, the user cannot specify the entrypoint or args.
*/
script?: string | null;
/**
* 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`.
*/
secretEnv?: string[] | null;
/**
* Output only. Status of the build step. At this time, build step status is only updated on build completion; step status is not updated in real-time as the build progresses.
*/
status?: string | null;
/**
* Time limit for executing this build step. If not defined, the step has no time limit and will be allowed to continue to run until either it completes or the build itself times out.
*/
timeout?: string | null;
/**
* Output only. Stores timing information for executing this build step.
*/
timing?: Schema$TimeSpan;
/**
* 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.
*/
volumes?: Schema$Volume[];
/**
* 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 `wait_for` have completed successfully. If `wait_for` is empty, this build step will start when all previous build steps in the `Build.Steps` list have completed successfully.
*/
waitFor?: string[] | null;
}
/**
* Configuration for an automated build in response to source repository changes.
*/
export interface Schema$BuildTrigger {
/**
* Configuration for manual approval to start a build invocation of this BuildTrigger.
*/
approvalConfig?: Schema$ApprovalConfig;
/**
* Autodetect build configuration. The following precedence is used (case insensitive): 1. cloudbuild.yaml 2. cloudbuild.yml 3. cloudbuild.json 4. Dockerfile Currently only available for GitHub App Triggers.
*/
autodetect?: boolean | null;
/**
* BitbucketServerTriggerConfig describes the configuration of a trigger that creates a build whenever a Bitbucket Server event is received.
*/
bitbucketServerTriggerConfig?: Schema$BitbucketServerTriggerConfig;
/**
* Contents of the build template.
*/
build?: Schema$Build;
/**
* Output only. Time when the trigger was created.
*/
createTime?: string | null;
/**
* Human-readable description of this trigger.
*/
description?: string | null;
/**
* Optional. The configuration of a trigger that creates a build whenever an event from the DeveloperConnect API is received.
*/
developerConnectEventConfig?: Schema$DeveloperConnectEventConfig;
/**
* If true, the trigger will never automatically execute a build.
*/
disabled?: boolean | null;
/**
* EventType allows the user to explicitly set the type of event to which this BuildTrigger should respond. This field will be validated against the rest of the configuration if it is set.
*/
eventType?: string | null;
/**
* Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml).
*/
filename?: string | null;
/**
* A Common Expression Language string.
*/
filter?: string | null;
/**
* The file source describing the local or remote Build template.
*/
gitFileSource?: Schema$GitFileSource;
/**
* GitHubEventsConfig describes the configuration of a trigger that creates a build whenever a GitHub event is received. Mutually exclusive with `trigger_template`.
*/
github?: Schema$GitHubEventsConfig;
/**
* GitLabEnterpriseEventsConfig describes the configuration of a trigger that creates a build whenever a GitLab Enterprise event is received.
*/
gitlabEnterpriseEventsConfig?: Schema$GitLabEventsConfig;
/**
* Output only. Unique identifier of the trigger.
*/
id?: string | null;
/**
* ignored_files and included_files are file glob matches using https://golang.org/pkg/path/filepath/#Match extended with support for "**". If ignored_files and changed files are both empty, then they are not used to determine whether or not to trigger a build. If ignored_files is not empty, then we ignore any files that match any of the ignored_file globs. If the change has no files that are outside of the ignored_files globs, then we do not trigger a build.
*/
ignoredFiles?: string[] | null;
/**
* If set to INCLUDE_BUILD_LOGS_WITH_STATUS, log url will be shown on GitHub page when build status is final. Setting this field to INCLUDE_BUILD_LOGS_WITH_STATUS for non GitHub triggers results in INVALID_ARGUMENT error.
*/
includeBuildLogs?: string | null;
/**
* If any of the files altered in the commit pass the ignored_files filter and included_files is empty, then as far as this filter is concerned, we should trigger the build. If any of the files altered in the commit pass the ignored_files filter and included_files is not empty, then we make sure that at least one of those files matches a included_files glob. If not, then we do not trigger a build.
*/
includedFiles?: string[] | null;
/**
* User-assigned name of the trigger. Must be unique within the project. Trigger names must meet the following requirements: + They must contain only alphanumeric characters and dashes. + They can be 1-64 characters long. + They must begin and end with an alphanumeric character.
*/
name?: string | null;
/**
* PubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published.
*/
pubsubConfig?: Schema$PubsubConfig;
/**
* The configuration of a trigger that creates a build whenever an event from Repo API is received.
*/
repositoryEventConfig?: Schema$RepositoryEventConfig;
/**
* The `Trigger` name with format: `projects/{project\}/locations/{location\}/triggers/{trigger\}`, where {trigger\} is a unique identifier generated by the service.
*/
resourceName?: string | null;
/**
* The service account used for all user-controlled operations including UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. If no service account is set and the legacy Cloud Build service account ([PROJECT_NUM]@cloudbuild.gserviceaccount.com) is the default for the project then it will be used instead. Format: `projects/{PROJECT_ID\}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL\}`
*/
serviceAccount?: string | null;
/**
* The repo and ref of the repository from which to build. This field is used only for those triggers that do not respond to SCM events. Triggers that respond to such events build source at whatever commit caused the event. This field is currently only used by Webhook, Pub/Sub, Manual, and Cron triggers.
*/
sourceToBuild?: Schema$GitRepoSource;
/**
* Substitutions for Build resource. The keys must match the following regular expression: `^_[A-Z0-9_]+$`.
*/
substitutions?: {[key: string]: string} | null;
/**
* Tags for annotation of a `BuildTrigger`
*/
tags?: string[] | null;
/**
* Template describing the types of source changes to trigger a build. Branch and tag names in trigger templates are interpreted as regular expressions. Any branch or tag change that matches that regular expression will trigger a build. Mutually exclusive with `github`.
*/
triggerTemplate?: Schema$RepoSource;
/**
* WebhookConfig describes the configuration of a trigger that creates a build whenever a webhook is sent to a trigger's webhook URL.
*/
webhookConfig?: Schema$WebhookConfig;
}
/**
* An image built by the pipeline.
*/
export interface Schema$BuiltImage {
/**
* Output only. Path to the artifact in Artifact Registry.
*/
artifactRegistryPackage?: string | null;
/**
* Docker Registry 2.0 digest.
*/
digest?: string | null;
/**
* Name used to push the container image to Google Container Registry, as presented to `docker push`.
*/
name?: string | null;
/**
* Output only. Stores timing information for pushing the specified image.
*/
pushTiming?: Schema$TimeSpan;
}
/**
* Request to cancel an ongoing build.
*/
export interface Schema$CancelBuildRequest {
/**
* Required. ID of the build.
*/
id?: string | null;
/**
* The name of the `Build` to cancel. Format: `projects/{project\}/locations/{location\}/builds/{build\}`
*/
name?: string | null;
/**
* Required. ID of the project.
*/
projectId?: string | null;
}
/**
* The request message for Operations.CancelOperation.
*/
export interface Schema$CancelOperationRequest {}
/**
* Location of the source in a 2nd-gen Google Cloud Build repository resource.
*/
export interface Schema$ConnectedRepository {
/**
* Optional. Directory, relative to the source root, in which to run the build.
*/
dir?: string | null;
/**
* Required. Name of the Google Cloud Build repository, formatted as `projects/x/locations/x/connections/x/repositories/x`.
*/
repository?: string | null;
/**
* Required. The revision to fetch from the Git repository such as a branch, a tag, a commit SHA, or any Git ref.
*/
revision?: string | null;
}
/**
* Metadata for `CreateBitbucketServerConfig` operation.
*/
export interface Schema$CreateBitbucketServerConfigOperationMetadata {
/**
* The resource name of the BitbucketServerConfig to be created. Format: `projects/{project\}/locations/{location\}/bitbucketServerConfigs/{id\}`.
*/
bitbucketServerConfig?: string | null;
/**
* Time the operation was completed.
*/
completeTime?: string | null;
/**
* Time the operation was created.
*/
createTime?: string | null;
}
/**
* Request to connect a repository from a connected Bitbucket Server host.
*/
export interface Schema$CreateBitbucketServerConnectedRepositoryRequest {
/**
* Required. The Bitbucket Server repository to connect.
*/
bitbucketServerConnectedRepository?: Schema$BitbucketServerConnectedRepository;
/**
* Required. The name of the `BitbucketServerConfig` that added connected repository. Format: `projects/{project\}/locations/{location\}/bitbucketServerConfigs/{config\}`
*/
parent?: string | null;
}
/**
* Metadata for `CreateGithubEnterpriseConfig` operation.
*/
export interface Schema$CreateGitHubEnterpriseConfigOperationMetadata {
/**
* Time the operation was completed.
*/
completeTime?: string | null;
/**
* Time the operation was created.
*/
createTime?: string | null;
/**
* The resource name of the GitHubEnterprise to be created. Format: `projects/{project\}/locations/{location\}/githubEnterpriseConfigs/{id\}`.
*/
githubEnterpriseConfig?: string | null;
}
/**
* Metadata for `CreateGitLabConfig` operation.
*/
export interface Schema$CreateGitLabConfigOperationMetadata {
/**
* Time the operation was completed.
*/
completeTime?: string | null;
/**
* Time the operation was created.
*/
createTime?: string | null;
/**
* The resource name of the GitLabConfig to be created. Format: `projects/{project\}/locations/{location\}/gitlabConfigs/{id\}`.
*/
gitlabConfig?: string | null;
}
/**
* Request to connect a repository from a connected GitLab host.
*/
export interface Schema$CreateGitLabConnectedRepositoryRequest {
/**
* Required. The GitLab repository to connect.
*/
gitlabConnectedRepository?: Schema$GitLabConnectedRepository;
/**
* Required. The name of the `GitLabConfig` that adds connected repository. Format: `projects/{project\}/locations/{location\}/gitLabConfigs/{config\}`
*/
parent?: string | null;
}
/**
* Metadata for the `CreateWorkerPool` operation.
*/
export interface Schema$CreateWorkerPoolOperationMetadata {
/**
* Time the operation was completed.
*/
completeTime?: string | null;
/**
* Time the operation was created.
*/
createTime?: string | null;
/**
* The resource name of the `WorkerPool` to create. Format: `projects/{project\}/locations/{location\}/workerPools/{worker_pool\}`.
*/
workerPool?: string | null;
}
/**
* The default service account used for `Builds`.
*/
export interface Schema$DefaultServiceAccount {
/**
* Identifier. Format: `projects/{project\}/locations/{location\}/defaultServiceAccount
*/
name?: string | null;
/**
* Output only. The email address of the service account identity that will be used for a build by default. This is returned in the format `projects/{project\}/serviceAccounts/{service_account\}` where `{service_account\}` could be the legacy Cloud Build SA, in the format [PROJECT_NUMBER]@cloudbuild.gserviceaccount.com or the Compute SA, in the format [PROJECT_NUMBER]-compute@developer.gserviceaccount.com. If no service account will be used by default, this will be empty.
*/
serviceAccountEmail?: string | null;
}
/**
* Metadata for `DeleteBitbucketServerConfig` operation.
*/
export interface Schema$DeleteBitbucketServerConfigOperationMetadata {
/**
* The resource name of the BitbucketServerConfig to be deleted. Format: `projects/{project\}/locations/{location\}/bitbucketServerConfigs/{id\}`.
*/
bitbucketServerConfig?: string | null;
/**
* Time the operation was completed.
*/
completeTime?: string | null;
/**
* Time the operation was created.
*/
createTime?: string | null;
}
/**
* Metadata for `DeleteGitHubEnterpriseConfig` operation.
*/
export interface Schema$DeleteGitHubEnterpriseConfigOperationMetadata {
/**
* Time the operation was completed.
*/
completeTime?: string | null;
/**
* Time the operation was created.
*/
createTime?: string | null;
/**
* The resource name of the GitHubEnterprise to be deleted. Format: `projects/{project\}/locations/{location\}/githubEnterpriseConfigs/{id\}`.
*/
githubEnterpriseConfig?: string | null;
}
/**
* Metadata for `DeleteGitLabConfig` operation.
*/
export interface Schema$DeleteGitLabConfigOperationMetadata {
/**
* Time the operation was completed.
*/
completeTime?: string | null;
/**
* Time the operation was created.
*/
createTime?: string | null;
/**
* The resource name of the GitLabConfig to be created. Format: `projects/{project\}/locations/{location\}/gitlabConfigs/{id\}`.
*/
gitlabConfig?: string | null;
}
/**
* Metadata for the `DeleteWorkerPool` operation.
*/
export interface Schema$DeleteWorkerPoolOperationMetadata {
/**
* Time the operation was completed.
*/
completeTime?: string | null;
/**
* Time the operation was created.
*/
createTime?: string | null;
/**
* The resource name of the `WorkerPool` being deleted. Format: `projects/{project\}/locations/{location\}/workerPools/{worker_pool\}`.
*/
workerPool?: string | null;
}
/**
* A dependency that the Cloud Build worker will fetch before executing user steps.
*/
export interface Schema$Dependency {
/**
* If set to true disable all dependency fetching (ignoring the default source as well).
*/
empty?: boolean | null;
/**
* Represents a git repository as a build dependency.
*/
gitSource?: Schema$GitSourceDependency;
}
/**
* This config defines the location of a source through Developer Connect.
*/
export interface Schema$DeveloperConnectConfig {
/**
* Required. Directory, relative to the source root, in which to run the build.
*/
dir?: string | null;
/**
* Required. The Developer Connect Git repository link, formatted as `projects/x/locations/x/connections/x/gitRepositoryLink/x`.
*/
gitRepositoryLink?: string | null;
/**
* Required. The revision to fetch from the Git repository such as a branch, a tag, a commit SHA, or any Git ref.
*/
revision?: string | null;
}
/**
* The configuration of a trigger that creates a build whenever an event from the DeveloperConnect API is received.
*/
export interface Schema$DeveloperConnectEventConfig {
/**
* Required. The Developer Connect Git repository link, formatted as `projects/x/locations/x/connections/x/gitRepositoryLink/x`.
*/
gitRepositoryLink?: string | null;
/**
* Output only. The type of DeveloperConnect GitRepositoryLink.
*/
gitRepositoryLinkType?: string | null;
/**
* Filter to match changes in pull requests.
*/
pullRequest?: Schema$PullRequestFilter;
/**
* Filter to match changes in refs like branches and tags.
*/
push?: Schema$PushFilter;
}
/**
* A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); \}
*/
export interface Schema$Empty {}
/**
* A fatal problem encountered during the execution of the build.
*/
export interface Schema$FailureInfo {
/**
* Explains