2020-10-05 02:08:45 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Deployments
|
2021-04-29 14:10:23 -04:00
|
|
|
# TODO: remove in https://gitlab.com/gitlab-org/gitlab/-/issues/329360
|
2020-10-05 02:08:45 -04:00
|
|
|
class ExecuteHooksWorker # rubocop:disable Scalability/IdempotentWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
|
2021-04-30 14:10:09 -04:00
|
|
|
sidekiq_options retry: 3
|
|
|
|
|
2020-10-05 02:08:45 -04:00
|
|
|
queue_namespace :deployment
|
|
|
|
feature_category :continuous_delivery
|
|
|
|
worker_resource_boundary :cpu
|
|
|
|
|
|
|
|
def perform(deployment_id)
|
|
|
|
if (deploy = Deployment.find_by_id(deployment_id))
|
2021-04-29 14:10:23 -04:00
|
|
|
deploy.execute_hooks(Time.current)
|
2020-10-05 02:08:45 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|