Cloud Build V1 API - Class Google::Cloud::Build::V1::Build (v0.26.2)

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.
  • $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.

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#approval

def approval() -> ::Google::Cloud::Build::V1::BuildApproval
Returns

#artifacts

def artifacts() -> ::Google::Cloud::Build::V1::Artifacts
Returns

#artifacts=

def artifacts=(value) -> ::Google::Cloud::Build::V1::Artifacts
Parameter
Returns

#available_secrets

def available_secrets() -> ::Google::Cloud::Build::V1::Secrets
Returns

#available_secrets=

def available_secrets=(value) -> ::Google::Cloud::Build::V1::Secrets
Parameter
Returns

#build_trigger_id

def build_trigger_id() -> ::String
Returns
  • (::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
Returns

#failure_info

def failure_info() -> ::Google::Cloud::Build::V1::Build::FailureInfo
Returns

#finish_time

def finish_time() -> ::Google::Protobuf::Timestamp
Returns
  • (::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
Returns
  • (::String) — Output only. Unique identifier of the build.

#images

def images() -> ::Array<::String>
Returns
  • (::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>
Parameter
  • 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.

Returns
  • (::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
Returns
  • (::String) — Output only. URL to logs for this build in Google Cloud Console.

#logs_bucket

def logs_bucket() -> ::String
Returns
  • (::String) — 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
Parameter
  • value (::String) — 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.
Returns
  • (::String) — 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
Returns
  • (::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
Returns

#options=

def options=(value) -> ::Google::Cloud::Build::V1::BuildOptions
Parameter
Returns

#project_id

def project_id() -> ::String
Returns
  • (::String) — Output only. ID of the project.

#queue_ttl

def queue_ttl() -> ::Google::Protobuf::Duration
Returns
  • (::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
Parameter
  • 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.

Returns
  • (::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
Returns

#secrets

def secrets() -> ::Array<::Google::Cloud::Build::V1::Secret>
Returns
  • (::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>
Parameter
  • 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
Returns
  • (::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
Returns
  • (::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
Parameter
  • 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.
Returns
  • (::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
Returns

#source=

def source=(value) -> ::Google::Cloud::Build::V1::Source
Parameter
Returns

#source_provenance

def source_provenance() -> ::Google::Cloud::Build::V1::SourceProvenance
Returns

#start_time

def start_time() -> ::Google::Protobuf::Timestamp
Returns

#status

def status() -> ::Google::Cloud::Build::V1::Build::Status
Returns

#status_detail

def status_detail() -> ::String
Returns
  • (::String) — Output only. Customer-readable message about the current status.

#steps

def steps() -> ::Array<::Google::Cloud::Build::V1::BuildStep>
Returns

#steps=

def steps=(value) -> ::Array<::Google::Cloud::Build::V1::BuildStep>
Parameter
Returns

#substitutions

def substitutions() -> ::Google::Protobuf::Map{::String => ::String}
Returns
  • (::Google::Protobuf::Map{::String => ::String}) — Substitutions data for Build resource.

#substitutions=

def substitutions=(value) -> ::Google::Protobuf::Map{::String => ::String}
Parameter
  • value (::Google::Protobuf::Map{::String => ::String}) — Substitutions data for Build resource.
Returns
  • (::Google::Protobuf::Map{::String => ::String}) — Substitutions data for Build resource.

#tags

def tags() -> ::Array<::String>
Returns
  • (::Array<::String>) — Tags for annotation of a Build. These are not docker tags.

#tags=

def tags=(value) -> ::Array<::String>
Parameter
  • value (::Array<::String>) — Tags for annotation of a Build. These are not docker tags.
Returns
  • (::Array<::String>) — Tags for annotation of a Build. These are not docker tags.

#timeout

def timeout() -> ::Google::Protobuf::Duration
Returns
  • (::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 from startTime.

    Default time is 60 minutes.

#timeout=

def timeout=(value) -> ::Google::Protobuf::Duration
Parameter
  • 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 from startTime.

    Default time is 60 minutes.

Returns
  • (::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 from startTime.

    Default time is 60 minutes.

#timing

def timing() -> ::Google::Protobuf::Map{::String => ::Google::Cloud::Build::V1::TimeSpan}
Returns
  • (::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 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.

#warnings

def warnings() -> ::Array<::Google::Cloud::Build::V1::Build::Warning>
Returns