Class: CircleCIReporter::Build
- Inherits:
-
Struct
- Object
- Struct
- CircleCIReporter::Build
- Defined in:
- lib/circleci_reporter/build.rb
Overview
Encapsulate a CircleCI build
Instance Attribute Summary collapse
-
#build_number ⇒ Integer
the ID of the CircleCI build.
-
#vcs_revision ⇒ String
revision of git.
Instance Method Summary collapse
- #artifacts ⇒ Array<Artifact>
- #find_artifact(string, node_index: nil) ⇒ Artifact?
- #match?(revision) ⇒ Boolean
Instance Attribute Details
#build_number ⇒ Integer
the ID of the CircleCI build
8 9 10 |
# File 'lib/circleci_reporter/build.rb', line 8 def build_number @build_number end |
#vcs_revision ⇒ String
revision of git
8 9 10 |
# File 'lib/circleci_reporter/build.rb', line 8 def vcs_revision @vcs_revision end |
Instance Method Details
#artifacts ⇒ Array<Artifact>
16 17 18 |
# File 'lib/circleci_reporter/build.rb', line 16 def artifacts @artifacts ||= CircleCIReporter.client.artifacts(build_number) end |
#find_artifact(string, node_index: nil) ⇒ Artifact?
23 24 25 |
# File 'lib/circleci_reporter/build.rb', line 23 def find_artifact(string, node_index: nil) artifacts.find { |artifact| artifact.match?(string, node_index: node_index) } end |
#match?(revision) ⇒ Boolean
11 12 13 |
# File 'lib/circleci_reporter/build.rb', line 11 def match?(revision) vcs_revision.start_with?(revision) end |