Class: Minfra::Cli::Dev
Instance Method Summary
collapse
Methods included from Logging
#debug, #deprecated, #error, #exit_error, #info, #warn
Methods included from Common
#run_cmd
Instance Method Details
#create ⇒ Object
14
15
16
|
# File 'lib/minfra/cli/commands/dev.rb', line 14
def create
kube.create
end
|
#describe ⇒ Object
9
10
11
|
# File 'lib/minfra/cli/commands/dev.rb', line 9
def describe
pp minfra_config.describe(options[:environment])
end
|
#destroy ⇒ Object
48
49
50
|
# File 'lib/minfra/cli/commands/dev.rb', line 48
def destroy
kube.destroy_dev_cluster
end
|
#envs ⇒ Object
53
54
55
|
# File 'lib/minfra/cli/commands/dev.rb', line 53
def envs
puts minfra_cli.envs.keys.join(', ')
end
|
#restart ⇒ Object
38
39
40
|
# File 'lib/minfra/cli/commands/dev.rb', line 38
def restart
kube.restart
end
|
#start ⇒ Object
43
44
45
|
# File 'lib/minfra/cli/commands/dev.rb', line 43
def start
restart
end
|
#upgrade ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/minfra/cli/commands/dev.rb', line 20
def upgrade
info 'Destroying existing dev cluster..'
destroy
Runner.run(
"mv #{minfra_config.base_path.join('me',
'kind.yaml.erb')} #{minfra_config.base_path.join('me', "kind_old_#{Time.now.strftime('%Y_%m_%dT%H_%M_%SZ')}.yaml.erb")}", print_stdout: true
)
Runner.run(
"mv #{minfra_config.base_path.join('me', 'kube',
'config')} #{minfra_config.base_path.join('me', 'kube', "config_old_#{Time.now.strftime('%Y_%m_%dT%H_%M_%SZ')}")}", print_stdout: true
)
Runner.run('yes | minfra setup dev', print_stdout: true) info 'Creating a new dev cluster..'
create
info 'I am done upgrading the dev cluster! 🎉'
end
|