Reference documentation and code samples for the Cloud Build V1 API class Google::Cloud::Build::V1::Build.
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.
Inherits
- Object
Extended By
- Google::Protobuf::MessageExts::ClassMethods
Includes
- Google::Protobuf::MessageExts
Methods
#approval
def approval() -> ::Google::Cloud::Build::V1::BuildApproval
- (::Google::Cloud::Build::V1::BuildApproval) — Output only. Describes this build's approval configuration, status, and result.
#artifacts
def artifacts() -> ::Google::Cloud::Build::V1::Artifacts
- (::Google::Cloud::Build::V1::Artifacts) — Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
#artifacts=
def artifacts=(value) -> ::Google::Cloud::Build::V1::Artifacts
- value (::Google::Cloud::Build::V1::Artifacts) — Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
- (::Google::Cloud::Build::V1::Artifacts) — Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
#available_secrets
def available_secrets() -> ::Google::Cloud::Build::V1::Secrets
- (::Google::Cloud::Build::V1::Secrets) — Secrets and secret environment variables.
#available_secrets=
def available_secrets=(value) -> ::Google::Cloud::Build::V1::Secrets
- value (::Google::Cloud::Build::V1::Secrets) — Secrets and secret environment variables.
- (::Google::Cloud::Build::V1::Secrets) — Secrets and secret environment variables.
#build_trigger_id
def build_trigger_id() -> ::String
-
(::String) — Output only. The ID of the
BuildTrigger
that triggered this build, if it was triggered automatically.
#create_time
def create_time() -> ::Google::Protobuf::Timestamp
- (::Google::Protobuf::Timestamp) — Output only. Time at which the request to create the build was received.
#failure_info
def failure_info() -> ::Google::Cloud::Build::V1::Build::FailureInfo
- (::Google::Cloud::Build::V1::Build::FailureInfo) — Output only. Contains information about the build when status=FAILURE.
#finish_time
def finish_time() -> ::Google::Protobuf::Timestamp
-
(::Google::Protobuf::Timestamp) — 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.
#id
def id() -> ::String
- (::String) — Output only. Unique identifier of the build.
#images
def images() -> ::Array<::String>
-
(::Array<::String>) — 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=
def images=(value) -> ::Array<::String>
-
value (::Array<::String>) — 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
.
-
(::Array<::String>) — 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
.
#log_url
def log_url() -> ::String
- (::String) — Output only. URL to logs for this build in Google Cloud Console.
#logs_bucket
def logs_bucket() -> ::String
-
(::String) — 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
.
#logs_bucket=
def logs_bucket=(value) -> ::String
-
value (::String) — 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) — 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
.
#name
def name() -> ::String
-
(::String) — Output only. The 'Build' name with format:
projects/{project}/locations/{location}/builds/{build}
, where {build} is a unique identifier generated by the service.
#options
def options() -> ::Google::Cloud::Build::V1::BuildOptions
- (::Google::Cloud::Build::V1::BuildOptions) — Special options for this build.
#options=
def options=(value) -> ::Google::Cloud::Build::V1::BuildOptions
- value (::Google::Cloud::Build::V1::BuildOptions) — Special options for this build.
- (::Google::Cloud::Build::V1::BuildOptions) — Special options for this build.
#project_id
def project_id() -> ::String
- (::String) — Output only. ID of the project.
#queue_ttl
def queue_ttl() -> ::Google::Protobuf::Duration
-
(::Google::Protobuf::Duration) — 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.
#queue_ttl=
def queue_ttl=(value) -> ::Google::Protobuf::Duration
-
value (::Google::Protobuf::Duration) — 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) — 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.
#results
def results() -> ::Google::Cloud::Build::V1::Results
- (::Google::Cloud::Build::V1::Results) — Output only. Results of the build.
#secrets
def secrets() -> ::Array<::Google::Cloud::Build::V1::Secret>
-
(::Array<::Google::Cloud::Build::V1::Secret>) — 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=
def secrets=(value) -> ::Array<::Google::Cloud::Build::V1::Secret>
-
value (::Array<::Google::Cloud::Build::V1::Secret>) — 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
-
(::Array<::Google::Cloud::Build::V1::Secret>) — 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
#service_account
def service_account() -> ::String
-
(::String) — 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.
#service_account=
def service_account=(value) -> ::String
-
value (::String) — 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.
-
(::String) — 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.
#source
def source() -> ::Google::Cloud::Build::V1::Source
- (::Google::Cloud::Build::V1::Source) — The location of the source files to build.
#source=
def source=(value) -> ::Google::Cloud::Build::V1::Source
- value (::Google::Cloud::Build::V1::Source) — The location of the source files to build.
- (::Google::Cloud::Build::V1::Source) — The location of the source files to build.
#source_provenance
def source_provenance() -> ::Google::Cloud::Build::V1::SourceProvenance
- (::Google::Cloud::Build::V1::SourceProvenance) — Output only. A permanent fixed identifier for source.
#start_time
def start_time() -> ::Google::Protobuf::Timestamp
- (::Google::Protobuf::Timestamp) — Output only. Time at which execution of the build was started.
#status
def status() -> ::Google::Cloud::Build::V1::Build::Status
- (::Google::Cloud::Build::V1::Build::Status) — Output only. Status of the build.
#status_detail
def status_detail() -> ::String
- (::String) — Output only. Customer-readable message about the current status.
#steps
def steps() -> ::Array<::Google::Cloud::Build::V1::BuildStep>
- (::Array<::Google::Cloud::Build::V1::BuildStep>) — Required. The operations to be performed on the workspace.
#steps=
def steps=(value) -> ::Array<::Google::Cloud::Build::V1::BuildStep>
- value (::Array<::Google::Cloud::Build::V1::BuildStep>) — Required. The operations to be performed on the workspace.
- (::Array<::Google::Cloud::Build::V1::BuildStep>) — Required. The operations to be performed on the workspace.
#substitutions
def substitutions() -> ::Google::Protobuf::Map{::String => ::String}
-
(::Google::Protobuf::Map{::String => ::String}) — Substitutions data for
Build
resource.
#substitutions=
def substitutions=(value) -> ::Google::Protobuf::Map{::String => ::String}
-
value (::Google::Protobuf::Map{::String => ::String}) — Substitutions data for
Build
resource.
-
(::Google::Protobuf::Map{::String => ::String}) — Substitutions data for
Build
resource.
#tags
def tags() -> ::Array<::String>
-
(::Array<::String>) — Tags for annotation of a
Build
. These are not docker tags.
#tags=
def tags=(value) -> ::Array<::String>
-
value (::Array<::String>) — Tags for annotation of a
Build
. These are not docker tags.
-
(::Array<::String>) — Tags for annotation of a
Build
. These are not docker tags.
#timeout
def timeout() -> ::Google::Protobuf::Duration
-
(::Google::Protobuf::Duration) — 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 fromstartTime
.Default time is ten minutes.
#timeout=
def timeout=(value) -> ::Google::Protobuf::Duration
-
value (::Google::Protobuf::Duration) — 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 fromstartTime
.Default time is ten minutes.
-
(::Google::Protobuf::Duration) — 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 fromstartTime
.Default time is ten minutes.
#timing
def timing() -> ::Google::Protobuf::Map{::String => ::Google::Cloud::Build::V1::TimeSpan}
-
(::Google::Protobuf::Map{::String => ::Google::Cloud::Build::V1::TimeSpan}) — 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.
#warnings
def warnings() -> ::Array<::Google::Cloud::Build::V1::Build::Warning>
- (::Array<::Google::Cloud::Build::V1::Build::Warning>) — Output only. Non-fatal problems encountered during the execution of the build.