Class: InchCI::Worker::Project::Build::SaveBuildData

Inherits:
Object
  • Object
show all
Defined in:
lib/inch_ci/worker/project/build/save_build_data.rb

Defined Under Namespace

Classes: BuildData

Constant Summary collapse

DUPLICATE_STATUS =
'duplicate'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(build, build_data, stderr = "") ⇒ SaveBuildData

Returns a new instance of SaveBuildData.

Parameters:

  • build_data (Hash)

    a Hash built from the 'build:' section of the worker output


18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 18

def initialize(build, build_data, stderr = "")
  @build = build
  @build_data = BuildData.new(build_data)
  @build_data.stderr = stderr
  Store.transaction do
    branch = ensure_project_and_branch_exist
    if @build_data.success?
      handle_successful_build(branch)
    else
      handle_failed_build(branch)
    end
  end
end

Class Method Details

.call(*args) ⇒ Object


12
13
14
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 12

def self.call(*args)
  new(*args)
end