debian-mirror-gitlab/app/services/ci/prepare_build_service.rb
2021-06-08 01:23:25 +05:30

27 lines
460 B
Ruby

# frozen_string_literal: true
module Ci
class PrepareBuildService
attr_reader :build
def initialize(build)
@build = build
end
def execute
prerequisites.each(&:complete!)
build.enqueue_preparing!
rescue StandardError => e
Gitlab::ErrorTracking.track_exception(e, build_id: build.id)
build.drop(:unmet_prerequisites)
end
private
def prerequisites
build.prerequisites
end
end
end