Class: Google::Apis::CloudbuildV1::Build

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/cloudbuild_v1/classes.rb,
lib/google/apis/cloudbuild_v1/representations.rb,
lib/google/apis/cloudbuild_v1/representations.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Build

Returns a new instance of Build.



909
910
911
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 909

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#approvalGoogle::Apis::CloudbuildV1::BuildApproval

BuildApproval describes a build's approval configuration, state, and result. Corresponds to the JSON property approval



729
730
731
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 729

def approval
  @approval
end

#artifactsGoogle::Apis::CloudbuildV1::Artifacts

Artifacts produced by a build that should be uploaded upon successful completion of all build steps. Corresponds to the JSON property artifacts



735
736
737
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 735

def artifacts
  @artifacts
end

#available_secretsGoogle::Apis::CloudbuildV1::Secrets

Secrets and secret environment variables. Corresponds to the JSON property availableSecrets



740
741
742
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 740

def available_secrets
  @available_secrets
end

#build_trigger_idString

Output only. The ID of the BuildTrigger that triggered this build, if it was triggered automatically. Corresponds to the JSON property buildTriggerId

Returns:

  • (String)


746
747
748
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 746

def build_trigger_id
  @build_trigger_id
end

#create_timeString

Output only. Time at which the request to create the build was received. Corresponds to the JSON property createTime

Returns:

  • (String)


751
752
753
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 751

def create_time
  @create_time
end

#dependenciesArray<Google::Apis::CloudbuildV1::Dependency>

Optional. Dependencies that the Cloud Build worker will fetch before executing user steps. Corresponds to the JSON property dependencies



757
758
759
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 757

def dependencies
  @dependencies
end

#failure_infoGoogle::Apis::CloudbuildV1::FailureInfo

A fatal problem encountered during the execution of the build. Corresponds to the JSON property failureInfo



762
763
764
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 762

def failure_info
  @failure_info
end

#finish_timeString

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. Corresponds to the JSON property finishTime

Returns:

  • (String)


768
769
770
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 768

def finish_time
  @finish_time
end

#git_configGoogle::Apis::CloudbuildV1::GitConfig

GitConfig is a configuration for git operations. Corresponds to the JSON property gitConfig



773
774
775
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 773

def git_config
  @git_config
end

#idString

Output only. Unique identifier of the build. Corresponds to the JSON property id

Returns:

  • (String)


778
779
780
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 778

def id
  @id
end

#imagesArray<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. Corresponds to the JSON property images

Returns:

  • (Array<String>)


787
788
789
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 787

def images
  @images
end

#log_urlString

Output only. URL to logs for this build in Google Cloud Console. Corresponds to the JSON property logUrl

Returns:

  • (String)


792
793
794
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 792

def log_url
  @log_url
end

#logs_bucketString

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. Corresponds to the JSON property logsBucket

Returns:

  • (String)


799
800
801
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 799

def logs_bucket
  @logs_bucket
end

#nameString

Output only. The 'Build' name with format: projects/project/locations/ location/builds/build`, wherebuildis a unique identifier generated by the service. Corresponds to the JSON propertyname`

Returns:

  • (String)


806
807
808
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 806

def name
  @name
end

#optionsGoogle::Apis::CloudbuildV1::BuildOptions

Optional arguments to enable specific features of builds. Corresponds to the JSON property options



811
812
813
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 811

def options
  @options
end

#project_idString

Output only. ID of the project. Corresponds to the JSON property projectId

Returns:

  • (String)


816
817
818
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 816

def project_id
  @project_id
end

#queue_ttlString

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. Corresponds to the JSON property queueTtl

Returns:

  • (String)


823
824
825
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 823

def queue_ttl
  @queue_ttl
end

#resultsGoogle::Apis::CloudbuildV1::Results

Artifacts created by the build pipeline. Corresponds to the JSON property results



828
829
830
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 828

def results
  @results
end

#secretsArray<Google::Apis::CloudbuildV1::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 Corresponds to the JSON property secrets



837
838
839
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 837

def secrets
  @secrets
end

#service_accountString

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. Corresponds to the JSON propertyserviceAccount`

Returns:

  • (String)


844
845
846
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 844

def 
  @service_account
end

#sourceGoogle::Apis::CloudbuildV1::Source

Location of the source in a supported storage service. Corresponds to the JSON property source



849
850
851
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 849

def source
  @source
end

#source_provenanceGoogle::Apis::CloudbuildV1::SourceProvenance

Provenance of the source. Ways to find the original source, or verify that some source was used for this build. Corresponds to the JSON property sourceProvenance



855
856
857
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 855

def source_provenance
  @source_provenance
end

#start_timeString

Output only. Time at which execution of the build was started. Corresponds to the JSON property startTime

Returns:

  • (String)


860
861
862
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 860

def start_time
  @start_time
end

#statusString

Output only. Status of the build. Corresponds to the JSON property status

Returns:

  • (String)


865
866
867
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 865

def status
  @status
end

#status_detailString

Output only. Customer-readable message about the current status. Corresponds to the JSON property statusDetail

Returns:

  • (String)


870
871
872
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 870

def status_detail
  @status_detail
end

#stepsArray<Google::Apis::CloudbuildV1::BuildStep>

Required. The operations to be performed on the workspace. Corresponds to the JSON property steps



875
876
877
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 875

def steps
  @steps
end

#substitutionsHash<String,String>

Substitutions data for Build resource. Corresponds to the JSON property substitutions

Returns:

  • (Hash<String,String>)


880
881
882
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 880

def substitutions
  @substitutions
end

#tagsArray<String>

Tags for annotation of a Build. These are not docker tags. Corresponds to the JSON property tags

Returns:

  • (Array<String>)


885
886
887
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 885

def tags
  @tags
end

#timeoutString

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. Corresponds to the JSON property timeout

Returns:

  • (String)


893
894
895
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 893

def timeout
  @timeout
end

#timingHash<String,Google::Apis::CloudbuildV1::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. Corresponds to the JSON property timing

Returns:



902
903
904
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 902

def timing
  @timing
end

#warningsArray<Google::Apis::CloudbuildV1::Warning>

Output only. Non-fatal problems encountered during the execution of the build. Corresponds to the JSON property warnings



907
908
909
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 907

def warnings
  @warnings
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
# File 'lib/google/apis/cloudbuild_v1/classes.rb', line 914

def update!(**args)
  @approval = args[:approval] if args.key?(:approval)
  @artifacts = args[:artifacts] if args.key?(:artifacts)
  @available_secrets = args[:available_secrets] if args.key?(:available_secrets)
  @build_trigger_id = args[:build_trigger_id] if args.key?(:build_trigger_id)
  @create_time = args[:create_time] if args.key?(:create_time)
  @dependencies = args[:dependencies] if args.key?(:dependencies)
  @failure_info = args[:failure_info] if args.key?(:failure_info)
  @finish_time = args[:finish_time] if args.key?(:finish_time)
  @git_config = args[:git_config] if args.key?(:git_config)
  @id = args[:id] if args.key?(:id)
  @images = args[:images] if args.key?(:images)
  @log_url = args[:log_url] if args.key?(:log_url)
  @logs_bucket = args[:logs_bucket] if args.key?(:logs_bucket)
  @name = args[:name] if args.key?(:name)
  @options = args[:options] if args.key?(:options)
  @project_id = args[:project_id] if args.key?(:project_id)
  @queue_ttl = args[:queue_ttl] if args.key?(:queue_ttl)
  @results = args[:results] if args.key?(:results)
  @secrets = args[:secrets] if args.key?(:secrets)
  @service_account = args[:service_account] if args.key?(:service_account)
  @source = args[:source] if args.key?(:source)
  @source_provenance = args[:source_provenance] if args.key?(:source_provenance)
  @start_time = args[:start_time] if args.key?(:start_time)
  @status = args[:status] if args.key?(:status)
  @status_detail = args[:status_detail] if args.key?(:status_detail)
  @steps = args[:steps] if args.key?(:steps)
  @substitutions = args[:substitutions] if args.key?(:substitutions)
  @tags = args[:tags] if args.key?(:tags)
  @timeout = args[:timeout] if args.key?(:timeout)
  @timing = args[:timing] if args.key?(:timing)
  @warnings = args[:warnings] if args.key?(:warnings)
end