diff options
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/all_queues.yml | 2 | ||||
-rw-r--r-- | app/workers/build_success_worker.rb | 12 | ||||
-rw-r--r-- | app/workers/cluster_provision_worker.rb | 2 | ||||
-rw-r--r-- | app/workers/pages_domain_ssl_renewal_cron_worker.rb | 14 | ||||
-rw-r--r-- | app/workers/pages_domain_ssl_renewal_worker.rb | 13 |
5 files changed, 29 insertions, 14 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index fd0cc5fb24e..e55962b629e 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -9,6 +9,7 @@ - cronjob:import_export_project_cleanup - cronjob:pages_domain_verification_cron - cronjob:pages_domain_removal_cron +- cronjob:pages_domain_ssl_renewal_cron - cronjob:pipeline_schedule - cronjob:prune_old_events - cronjob:remove_expired_group_links @@ -133,6 +134,7 @@ - new_note - pages - pages_domain_verification +- pages_domain_ssl_renewal - plugin - post_receive - process_commit diff --git a/app/workers/build_success_worker.rb b/app/workers/build_success_worker.rb index 9a865fea621..ac947f3cf38 100644 --- a/app/workers/build_success_worker.rb +++ b/app/workers/build_success_worker.rb @@ -9,7 +9,6 @@ class BuildSuccessWorker # rubocop: disable CodeReuse/ActiveRecord def perform(build_id) Ci::Build.find_by(id: build_id).try do |build| - create_deployment(build) if build.has_environment? stop_environment(build) if build.stops_environment? end end @@ -18,17 +17,6 @@ class BuildSuccessWorker private ## - # Deprecated: - # As of 11.5, we started creating a deployment record when ci_builds record is created. - # Therefore we no longer need to create a deployment, after a build succeeded. - # We're leaving this code for the transition period, but we can remove this code in 11.6. - def create_deployment(build) - build.create_deployment.try do |deployment| - deployment.succeed - end - end - - ## # TODO: This should be processed in DeploymentSuccessWorker once we started storing `action` value in `deployments` records def stop_environment(build) build.persisted_environment.fire_state_event(:stop) diff --git a/app/workers/cluster_provision_worker.rb b/app/workers/cluster_provision_worker.rb index 926ae2b7286..59de7903c1c 100644 --- a/app/workers/cluster_provision_worker.rb +++ b/app/workers/cluster_provision_worker.rb @@ -9,8 +9,6 @@ class ClusterProvisionWorker cluster.provider.try do |provider| Clusters::Gcp::ProvisionService.new.execute(provider) if cluster.gcp? end - - ClusterConfigureWorker.perform_async(cluster.id) if cluster.user? end end end diff --git a/app/workers/pages_domain_ssl_renewal_cron_worker.rb b/app/workers/pages_domain_ssl_renewal_cron_worker.rb new file mode 100644 index 00000000000..40c34d29970 --- /dev/null +++ b/app/workers/pages_domain_ssl_renewal_cron_worker.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class PagesDomainSslRenewalCronWorker + include ApplicationWorker + include CronjobQueue + + def perform + PagesDomain.need_auto_ssl_renewal.find_each do |domain| + next unless ::Gitlab::LetsEncrypt.enabled?(domain) + + PagesDomainSslRenewalWorker.perform_async(domain.id) + end + end +end diff --git a/app/workers/pages_domain_ssl_renewal_worker.rb b/app/workers/pages_domain_ssl_renewal_worker.rb new file mode 100644 index 00000000000..b32458ca777 --- /dev/null +++ b/app/workers/pages_domain_ssl_renewal_worker.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class PagesDomainSslRenewalWorker + include ApplicationWorker + + def perform(domain_id) + domain = PagesDomain.find_by_id(domain_id) + return unless domain&.enabled? + return unless ::Gitlab::LetsEncrypt.enabled?(domain) + + ::PagesDomains::ObtainLetsEncryptCertificateService.new(domain).execute + end +end |