2019-04-26 21:08:41 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Deployments
|
|
|
|
class FinishedWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
|
|
|
|
queue_namespace :deployment
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :continuous_delivery
|
2019-10-30 15:14:17 +00:00
|
|
|
worker_resource_boundary :cpu
|
2019-04-26 21:08:41 +00:00
|
|
|
|
|
|
|
def perform(deployment_id)
|
2020-01-03 18:07:40 +00:00
|
|
|
if (deploy = Deployment.find_by_id(deployment_id))
|
|
|
|
link_merge_requests(deploy)
|
|
|
|
deploy.execute_hooks
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def link_merge_requests(deployment)
|
|
|
|
unless Feature.enabled?(:deployment_merge_requests, deployment.project)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
LinkMergeRequestsService.new(deployment).execute
|
2019-04-26 21:08:41 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|