public final class Build extends GeneratedMessageV3 implements BuildOrBuilder
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.
- $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.
Protobuf type google.devtools.cloudbuild.v1.Build
Static Fields
APPROVAL_FIELD_NUMBER
public static final int APPROVAL_FIELD_NUMBER
Field Value
ARTIFACTS_FIELD_NUMBER
public static final int ARTIFACTS_FIELD_NUMBER
Field Value
AVAILABLE_SECRETS_FIELD_NUMBER
public static final int AVAILABLE_SECRETS_FIELD_NUMBER
Field Value
BUILD_TRIGGER_ID_FIELD_NUMBER
public static final int BUILD_TRIGGER_ID_FIELD_NUMBER
Field Value
CREATE_TIME_FIELD_NUMBER
public static final int CREATE_TIME_FIELD_NUMBER
Field Value
FAILURE_INFO_FIELD_NUMBER
public static final int FAILURE_INFO_FIELD_NUMBER
Field Value
FINISH_TIME_FIELD_NUMBER
public static final int FINISH_TIME_FIELD_NUMBER
Field Value
ID_FIELD_NUMBER
public static final int ID_FIELD_NUMBER
Field Value
IMAGES_FIELD_NUMBER
public static final int IMAGES_FIELD_NUMBER
Field Value
LOGS_BUCKET_FIELD_NUMBER
public static final int LOGS_BUCKET_FIELD_NUMBER
Field Value
LOG_URL_FIELD_NUMBER
public static final int LOG_URL_FIELD_NUMBER
Field Value
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
Field Value
OPTIONS_FIELD_NUMBER
public static final int OPTIONS_FIELD_NUMBER
Field Value
PROJECT_ID_FIELD_NUMBER
public static final int PROJECT_ID_FIELD_NUMBER
Field Value
QUEUE_TTL_FIELD_NUMBER
public static final int QUEUE_TTL_FIELD_NUMBER
Field Value
RESULTS_FIELD_NUMBER
public static final int RESULTS_FIELD_NUMBER
Field Value
SECRETS_FIELD_NUMBER
public static final int SECRETS_FIELD_NUMBER
Field Value
SERVICE_ACCOUNT_FIELD_NUMBER
public static final int SERVICE_ACCOUNT_FIELD_NUMBER
Field Value
SOURCE_FIELD_NUMBER
public static final int SOURCE_FIELD_NUMBER
Field Value
SOURCE_PROVENANCE_FIELD_NUMBER
public static final int SOURCE_PROVENANCE_FIELD_NUMBER
Field Value
START_TIME_FIELD_NUMBER
public static final int START_TIME_FIELD_NUMBER
Field Value
STATUS_DETAIL_FIELD_NUMBER
public static final int STATUS_DETAIL_FIELD_NUMBER
Field Value
STATUS_FIELD_NUMBER
public static final int STATUS_FIELD_NUMBER
Field Value
STEPS_FIELD_NUMBER
public static final int STEPS_FIELD_NUMBER
Field Value
SUBSTITUTIONS_FIELD_NUMBER
public static final int SUBSTITUTIONS_FIELD_NUMBER
Field Value
public static final int TAGS_FIELD_NUMBER
Field Value
TIMEOUT_FIELD_NUMBER
public static final int TIMEOUT_FIELD_NUMBER
Field Value
TIMING_FIELD_NUMBER
public static final int TIMING_FIELD_NUMBER
Field Value
WARNINGS_FIELD_NUMBER
public static final int WARNINGS_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static Build getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static Build.Builder newBuilder()
Returns
newBuilder(Build prototype)
public static Build.Builder newBuilder(Build prototype)
Parameter
Name | Description |
prototype | Build
|
Returns
public static Build parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static Build parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static Build parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Build parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static Build parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Build parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Build parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static Build parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Build parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static Build parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static Build parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Build parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<Build> parser()
Returns
Methods
containsSubstitutions(String key)
public boolean containsSubstitutions(String key)
Substitutions data for Build
resource.
map<string, string> substitutions = 29;
Parameter
Returns
containsTiming(String key)
public boolean containsTiming(String key)
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 specified images.
- 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.
map<string, .google.devtools.cloudbuild.v1.TimeSpan> timing = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter
Returns
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getApproval()
public BuildApproval getApproval()
Output only. Describes this build's approval configuration, status,
and result.
.google.devtools.cloudbuild.v1.BuildApproval approval = 44 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getApprovalOrBuilder()
public BuildApprovalOrBuilder getApprovalOrBuilder()
Output only. Describes this build's approval configuration, status,
and result.
.google.devtools.cloudbuild.v1.BuildApproval approval = 44 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getArtifacts()
public Artifacts getArtifacts()
Artifacts produced by the build that should be uploaded upon
successful completion of all build steps.
.google.devtools.cloudbuild.v1.Artifacts artifacts = 37;
Returns
getArtifactsOrBuilder()
public ArtifactsOrBuilder getArtifactsOrBuilder()
Artifacts produced by the build that should be uploaded upon
successful completion of all build steps.
.google.devtools.cloudbuild.v1.Artifacts artifacts = 37;
Returns
getAvailableSecrets()
public Secrets getAvailableSecrets()
Secrets and secret environment variables.
.google.devtools.cloudbuild.v1.Secrets available_secrets = 47;
Returns
Type | Description |
Secrets | The availableSecrets.
|
getAvailableSecretsOrBuilder()
public SecretsOrBuilder getAvailableSecretsOrBuilder()
Secrets and secret environment variables.
.google.devtools.cloudbuild.v1.Secrets available_secrets = 47;
Returns
getBuildTriggerId()
public String getBuildTriggerId()
Output only. The ID of the BuildTrigger
that triggered this build, if it
was triggered automatically.
string build_trigger_id = 22 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
Type | Description |
String | The buildTriggerId.
|
getBuildTriggerIdBytes()
public ByteString getBuildTriggerIdBytes()
Output only. The ID of the BuildTrigger
that triggered this build, if it
was triggered automatically.
string build_trigger_id = 22 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
Type | Description |
ByteString | The bytes for buildTriggerId.
|
getCreateTime()
public Timestamp getCreateTime()
Output only. Time at which the request to create the build was received.
.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getCreateTimeOrBuilder()
public TimestampOrBuilder getCreateTimeOrBuilder()
Output only. Time at which the request to create the build was received.
.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getDefaultInstanceForType()
public Build getDefaultInstanceForType()
Returns
getFailureInfo()
public Build.FailureInfo getFailureInfo()
Output only. Contains information about the build when status=FAILURE.
.google.devtools.cloudbuild.v1.Build.FailureInfo failure_info = 51 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getFailureInfoOrBuilder()
public Build.FailureInfoOrBuilder getFailureInfoOrBuilder()
Output only. Contains information about the build when status=FAILURE.
.google.devtools.cloudbuild.v1.Build.FailureInfo failure_info = 51 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getFinishTime()
public Timestamp getFinishTime()
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.
.google.protobuf.Timestamp finish_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getFinishTimeOrBuilder()
public TimestampOrBuilder getFinishTimeOrBuilder()
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.
.google.protobuf.Timestamp finish_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getId()
Output only. Unique identifier of the build.
string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getIdBytes()
public ByteString getIdBytes()
Output only. Unique identifier of the build.
string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getImages(int index)
public String getImages(int index)
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
.
repeated string images = 13;
Parameter
Name | Description |
index | int
The index of the element to return.
|
Returns
Type | Description |
String | The images at the given index.
|
getImagesBytes(int index)
public ByteString getImagesBytes(int index)
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
.
repeated string images = 13;
Parameter
Name | Description |
index | int
The index of the value to return.
|
Returns
Type | Description |
ByteString | The bytes of the images at the given index.
|
getImagesCount()
public int getImagesCount()
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
.
repeated string images = 13;
Returns
Type | Description |
int | The count of images.
|
getImagesList()
public ProtocolStringList getImagesList()
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
.
repeated string images = 13;
Returns
getLogUrl()
public String getLogUrl()
Output only. URL to logs for this build in Google Cloud Console.
string log_url = 25 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
Type | Description |
String | The logUrl.
|
getLogUrlBytes()
public ByteString getLogUrlBytes()
Output only. URL to logs for this build in Google Cloud Console.
string log_url = 25 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getLogsBucket()
public String getLogsBucket()
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
.
string logs_bucket = 19;
Returns
Type | Description |
String | The logsBucket.
|
getLogsBucketBytes()
public ByteString getLogsBucketBytes()
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
.
string logs_bucket = 19;
Returns
Type | Description |
ByteString | The bytes for logsBucket.
|
getName()
Output only. The 'Build' name with format:
projects/{project}/locations/{location}/builds/{build}
, where {build}
is a unique identifier generated by the service.
string name = 45 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
Type | Description |
String | The name.
|
getNameBytes()
public ByteString getNameBytes()
Output only. The 'Build' name with format:
projects/{project}/locations/{location}/builds/{build}
, where {build}
is a unique identifier generated by the service.
string name = 45 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getOptions()
public BuildOptions getOptions()
Special options for this build.
.google.devtools.cloudbuild.v1.BuildOptions options = 23;
Returns
getOptionsOrBuilder()
public BuildOptionsOrBuilder getOptionsOrBuilder()
Special options for this build.
.google.devtools.cloudbuild.v1.BuildOptions options = 23;
Returns
getParserForType()
public Parser<Build> getParserForType()
Returns
Overrides
getProjectId()
public String getProjectId()
Output only. ID of the project.
string project_id = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
Type | Description |
String | The projectId.
|
getProjectIdBytes()
public ByteString getProjectIdBytes()
Output only. ID of the project.
string project_id = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getQueueTtl()
public Duration getQueueTtl()
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.
.google.protobuf.Duration queue_ttl = 40;
Returns
getQueueTtlOrBuilder()
public DurationOrBuilder getQueueTtlOrBuilder()
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.
.google.protobuf.Duration queue_ttl = 40;
Returns
getResults()
public Results getResults()
Output only. Results of the build.
.google.devtools.cloudbuild.v1.Results results = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getResultsOrBuilder()
public ResultsOrBuilder getResultsOrBuilder()
Output only. Results of the build.
.google.devtools.cloudbuild.v1.Results results = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
getSecrets(int index)
public Secret getSecrets(int index)
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