21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/uffizzi/cli/install.rb', line 21
def controller(hostname)
Uffizzi::AuthHelper.check_login
check_account_can_install
InstallService.kubectl_exists?
InstallService.helm_exists?
if options[:context].present? && options[:context] != InstallService.kubeconfig_current_context
InstallService.set_current_context(options[:context])
end
ask_confirmation(options[:namespace])
uri = parse_hostname(hostname)
installation_options = build_installation_options(uri)
check_existence_controller_settings(uri, installation_options)
helm_values = build_helm_values(installation_options)
InstallService.create_helm_values_file(helm_values)
helm_set_repo
InstallService.helm_install!(namespace)
InstallService.delete_helm_values_file
Uffizzi.ui.say('Helm release is deployed')
controller_setting_params = build_controller_setting_params(uri, installation_options)
if existing_controller_setting.blank?
create_controller_settings(controller_setting_params)
set_account_installation
end
Uffizzi.ui.say('Controller settings are saved')
say_success(uri)
end
|