2017-11-02 13:55:02 -04:00
|
|
|
module Clusters
|
|
|
|
module Applications
|
|
|
|
class InstallService < BaseHelmService
|
|
|
|
def execute
|
|
|
|
return unless app.scheduled?
|
|
|
|
|
|
|
|
begin
|
2017-11-06 09:43:02 -05:00
|
|
|
app.make_installing!
|
2017-11-07 09:26:14 -05:00
|
|
|
helm_api.install(install_command)
|
2017-11-02 13:55:02 -04:00
|
|
|
|
2017-11-06 09:43:02 -05:00
|
|
|
ClusterWaitForAppInstallationWorker.perform_in(
|
|
|
|
ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id)
|
2018-03-15 03:14:13 -04:00
|
|
|
rescue Kubeclient::HttpError => ke
|
2017-11-02 13:55:02 -04:00
|
|
|
app.make_errored!("Kubernetes error: #{ke.message}")
|
2018-05-16 05:01:13 -04:00
|
|
|
rescue StandardError => e
|
|
|
|
app.make_errored!("Can't start installation process. #{e.message}")
|
2017-11-02 13:55:02 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|