debian-mirror-gitlab/app/services/ci/prepare_build_service.rb

28 lines
451 B
Ruby
Raw Normal View History

2019-05-18 00:54:41 +05:30
# frozen_string_literal: true
module Ci
class PrepareBuildService
attr_reader :build
def initialize(build)
@build = build
end
def execute
prerequisites.each(&:complete!)
build.enqueue!
rescue => e
Gitlab::Sentry.track_acceptable_exception(e, extra: { build_id: build.id })
build.drop(:unmet_prerequisites)
end
private
def prerequisites
build.prerequisites
end
end
end