debian-mirror-gitlab/app/services/clusters/applications/install_service.rb

24 lines
639 B
Ruby
Raw Normal View History

2018-11-08 19:23:39 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
module Clusters
module Applications
class InstallService < BaseHelmService
def execute
return unless app.scheduled?
2019-07-07 11:18:12 +05:30
app.make_installing!
helm_api.install(install_command)
2018-03-17 18:26:18 +05:30
2019-07-07 11:18:12 +05:30
ClusterWaitForAppInstallationWorker.perform_in(
ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id)
rescue Kubeclient::HttpError => e
log_error(e)
app.make_errored!("Kubernetes error: #{e.error_code}")
rescue StandardError => e
log_error(e)
app.make_errored!("Can't start installation process.")
2018-03-17 18:26:18 +05:30
end
end
end
end