Class: Ci::PrepareBuildService

Inherits:
Object
  • Object
show all
Defined in:
app/services/ci/prepare_build_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(build) ⇒ PrepareBuildService

Returns a new instance of PrepareBuildService.


7
8
9
# File 'app/services/ci/prepare_build_service.rb', line 7

def initialize(build)
  @build = build
end

Instance Attribute Details

#buildObject (readonly)

Returns the value of attribute build


5
6
7
# File 'app/services/ci/prepare_build_service.rb', line 5

def build
  @build
end

Instance Method Details

#executeObject


11
12
13
14
15
16
17
18
19
# File 'app/services/ci/prepare_build_service.rb', line 11

def execute
  prerequisites.each(&:complete!)

  build.enqueue_preparing!
rescue => e
  Gitlab::ErrorTracking.track_exception(e, build_id: build.id)

  build.drop(:unmet_prerequisites)
end