uffizzi-cli 2.0.36 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uffizzi/auth_helper.rb +2 -0
- data/lib/uffizzi/cli/cluster.rb +21 -10
- data/lib/uffizzi/cli/dev.rb +177 -0
- data/lib/uffizzi/cli/login.rb +4 -4
- data/lib/uffizzi/cli.rb +6 -2
- data/lib/uffizzi/helpers/login_helper.rb +3 -2
- data/lib/uffizzi/services/cluster/disconnect_service.rb +3 -3
- data/lib/uffizzi/services/cluster_service.rb +2 -1
- data/lib/uffizzi/shell.rb +9 -0
- data/lib/uffizzi/version.rb +1 -1
- data/man/uffizzi-cluster-create +9 -6
- data/man/uffizzi-cluster-create.ronn +9 -6
- data/man/uffizzi-cluster-delete +7 -1
- data/man/uffizzi-cluster-delete.ronn +5 -0
- data/man/uffizzi-cluster-disconnect +2 -2
- data/man/uffizzi-dev-start +29 -0
- data/man/uffizzi-dev-start.ronn +22 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fc9021c07ec1fbbbd32baab4e37dcdf3eb9b7368843701e9c0a086da8eefefe
|
4
|
+
data.tar.gz: ccf95b0bd9ae6fffa906a15012825a9c9d4b209263e0735ce200d5ba5ca953b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeb135bb03097b24c39b408e10bc31fa995d3cd4da3284eacc07be126b04a5aaf18a02e5cf432e5e9f46a24bb842c79209d3100ec8d0b94efde7f8c9a5b43ae4
|
7
|
+
data.tar.gz: 29d2160ec30fd61f9f5bf96ef24dea226b6388e9ab1bcf47b3c6a66a2b518df17bc9013d5d036dc5f3c6b517e30f2de0015a46d2ce933f8332113943e84a9b54
|
data/lib/uffizzi/auth_helper.rb
CHANGED
data/lib/uffizzi/cli/cluster.rb
CHANGED
@@ -25,15 +25,15 @@ module Uffizzi
|
|
25
25
|
run('list')
|
26
26
|
end
|
27
27
|
|
28
|
-
desc 'create', 'Create a cluster'
|
28
|
+
desc 'create [NAME]', 'Create a cluster'
|
29
29
|
method_option :name, type: :string, required: false, aliases: '-n'
|
30
30
|
method_option :kubeconfig, type: :string, required: false, aliases: '-k'
|
31
31
|
method_option :manifest, type: :string, required: false, aliases: '-m'
|
32
|
-
method_option :'update-current-context', type: :boolean, required: false
|
32
|
+
method_option :'update-current-context', type: :boolean, required: false, default: true
|
33
33
|
method_option :output, required: false, type: :string, aliases: '-o', enum: ['json', 'pretty-json']
|
34
34
|
method_option :'creation-source', required: false, type: :string
|
35
|
-
def create
|
36
|
-
run('create')
|
35
|
+
def create(name = nil)
|
36
|
+
run('create', { name: name })
|
37
37
|
end
|
38
38
|
|
39
39
|
desc 'describe [NAME]', 'Describe a cluster'
|
@@ -43,7 +43,7 @@ module Uffizzi
|
|
43
43
|
end
|
44
44
|
|
45
45
|
desc 'delete [NAME]', 'Delete a cluster'
|
46
|
-
method_option :'delete-config', required: false, type: :boolean,
|
46
|
+
method_option :'delete-config', required: false, type: :boolean, default: true
|
47
47
|
def delete(name)
|
48
48
|
run('delete', cluster_name: name)
|
49
49
|
end
|
@@ -76,7 +76,7 @@ module Uffizzi
|
|
76
76
|
when 'list'
|
77
77
|
handle_list_command(project_slug)
|
78
78
|
when 'create'
|
79
|
-
handle_create_command(project_slug)
|
79
|
+
handle_create_command(project_slug, command_args)
|
80
80
|
when 'describe'
|
81
81
|
handle_describe_command(project_slug, command_args)
|
82
82
|
when 'delete'
|
@@ -104,9 +104,17 @@ module Uffizzi
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
|
107
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
108
|
+
def handle_create_command(project_slug, command_args)
|
108
109
|
Uffizzi.ui.disable_stdout if Uffizzi.ui.output_format
|
109
|
-
|
110
|
+
|
111
|
+
if options[:name]
|
112
|
+
msg = 'DEPRECATION WARNING: The --name option is deprecated and will be removed in the newer versions.' \
|
113
|
+
' Please use a positional argument instead: uffizzi cluster create my-awesome-name'
|
114
|
+
Uffizzi.ui.say(msg)
|
115
|
+
end
|
116
|
+
|
117
|
+
cluster_name = command_args[:name] || options[:name] || ClusterService.generate_name
|
110
118
|
creation_source = options[:"creation-source"] || MANUAL
|
111
119
|
|
112
120
|
unless ClusterService.valid_name?(cluster_name)
|
@@ -133,6 +141,7 @@ module Uffizzi
|
|
133
141
|
rescue SystemExit, Interrupt, SocketError
|
134
142
|
handle_interrupt_creation(cluster_name, ConfigFile.read_option(:server), project_slug)
|
135
143
|
end
|
144
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
136
145
|
|
137
146
|
def handle_describe_command(project_slug, command_args)
|
138
147
|
cluster_data = fetch_cluster_data(project_slug, command_args[:cluster_name])
|
@@ -150,7 +159,7 @@ module Uffizzi
|
|
150
159
|
kubeconfig = parse_kubeconfig(cluster_data[:kubeconfig])
|
151
160
|
|
152
161
|
handle_delete_cluster(project_slug, cluster_name)
|
153
|
-
exclude_kubeconfig(cluster_data[:id], kubeconfig)
|
162
|
+
exclude_kubeconfig(cluster_data[:id], kubeconfig) if kubeconfig.present?
|
154
163
|
end
|
155
164
|
|
156
165
|
def exclude_kubeconfig(cluster_id, kubeconfig)
|
@@ -308,7 +317,7 @@ module Uffizzi
|
|
308
317
|
end
|
309
318
|
|
310
319
|
def handle_succeed_create_response(cluster_data)
|
311
|
-
kubeconfig_path = options[:kubeconfig]
|
320
|
+
kubeconfig_path = options[:kubeconfig] || KubeconfigService.default_path
|
312
321
|
is_update_current_context = options[:'update-current-context']
|
313
322
|
parsed_kubeconfig = parse_kubeconfig(cluster_data[:kubeconfig])
|
314
323
|
rendered_cluster_data = render_cluster_data(cluster_data)
|
@@ -365,6 +374,8 @@ module Uffizzi
|
|
365
374
|
end
|
366
375
|
|
367
376
|
def parse_kubeconfig(kubeconfig)
|
377
|
+
return if kubeconfig.nil?
|
378
|
+
|
368
379
|
Psych.safe_load(Base64.decode64(kubeconfig))
|
369
380
|
end
|
370
381
|
|
@@ -0,0 +1,177 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'uffizzi/services/command_service'
|
4
|
+
require 'uffizzi/services/cluster_service'
|
5
|
+
require 'uffizzi/services/kubeconfig_service'
|
6
|
+
|
7
|
+
module Uffizzi
|
8
|
+
class Cli::Dev < Thor
|
9
|
+
include ApiClient
|
10
|
+
|
11
|
+
desc 'start [CONFIG]', 'Start dev environment'
|
12
|
+
def start(config_path = 'skaffold.yaml')
|
13
|
+
check_skaffold_existence
|
14
|
+
check_login
|
15
|
+
cluster_id, cluster_name = start_create_cluster
|
16
|
+
kubeconfig = wait_cluster_creation(cluster_name)
|
17
|
+
launch_scaffold(config_path)
|
18
|
+
ensure
|
19
|
+
if defined?(cluster_name).present? && defined?(cluster_id).present?
|
20
|
+
kubeconfig = defined?(kubeconfig).present? ? kubeconfig : nil
|
21
|
+
handle_delete_cluster(cluster_id, cluster_name, kubeconfig)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def check_login
|
28
|
+
raise Uffizzi::Error.new('You are not logged in.') unless Uffizzi::AuthHelper.signed_in?
|
29
|
+
raise Uffizzi::Error.new('This command needs project to be set in config file') unless CommandService.project_set?(options)
|
30
|
+
end
|
31
|
+
|
32
|
+
def start_create_cluster
|
33
|
+
cluster_name = ClusterService.generate_name
|
34
|
+
creation_source = MANUAL
|
35
|
+
params = cluster_creation_params(cluster_name, creation_source)
|
36
|
+
Uffizzi.ui.say('Start creating a cluster')
|
37
|
+
response = create_cluster(ConfigFile.read_option(:server), project_slug, params)
|
38
|
+
return ResponseHelper.handle_failed_response(response) unless ResponseHelper.created?(response)
|
39
|
+
|
40
|
+
cluster_id = response.dig(:body, :cluster, :id)
|
41
|
+
cluster_name = response.dig(:body, :cluster, :name)
|
42
|
+
|
43
|
+
[cluster_id, cluster_name]
|
44
|
+
end
|
45
|
+
|
46
|
+
def wait_cluster_creation(cluster_name)
|
47
|
+
Uffizzi.ui.say('Checking the cluster status...')
|
48
|
+
cluster_data = ClusterService.wait_cluster_deploy(project_slug, cluster_name, ConfigFile.read_option(:oidc_token))
|
49
|
+
|
50
|
+
if ClusterService.failed?(cluster_data[:state])
|
51
|
+
Uffizzi.ui.say_error_and_exit("Cluster with name: #{cluster_name} failed to be created.")
|
52
|
+
end
|
53
|
+
|
54
|
+
handle_succeed_cluster_creation(cluster_data)
|
55
|
+
parse_kubeconfig(cluster_data[:kubeconfig])
|
56
|
+
end
|
57
|
+
|
58
|
+
def handle_succeed_cluster_creation(cluster_data)
|
59
|
+
kubeconfig_path = KubeconfigService.default_path
|
60
|
+
parsed_kubeconfig = parse_kubeconfig(cluster_data[:kubeconfig])
|
61
|
+
|
62
|
+
Uffizzi.ui.say("Cluster with name: #{cluster_data[:name]} was created.")
|
63
|
+
|
64
|
+
save_kubeconfig(parsed_kubeconfig, kubeconfig_path)
|
65
|
+
update_clusters_config(cluster_data[:id], kubeconfig_path: kubeconfig_path)
|
66
|
+
end
|
67
|
+
|
68
|
+
def save_kubeconfig(kubeconfig, kubeconfig_path)
|
69
|
+
KubeconfigService.save_to_filepath(kubeconfig_path, kubeconfig) do |kubeconfig_by_path|
|
70
|
+
merged_kubeconfig = KubeconfigService.merge(kubeconfig_by_path, kubeconfig)
|
71
|
+
|
72
|
+
new_current_context = KubeconfigService.get_current_context(kubeconfig)
|
73
|
+
new_kubeconfig = KubeconfigService.update_current_context(merged_kubeconfig, new_current_context)
|
74
|
+
|
75
|
+
next new_kubeconfig if kubeconfig_by_path.nil?
|
76
|
+
|
77
|
+
previous_current_context = KubeconfigService.get_current_context(kubeconfig_by_path)
|
78
|
+
save_previous_current_context(kubeconfig_path, previous_current_context)
|
79
|
+
new_kubeconfig
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def update_clusters_config(id, params)
|
84
|
+
clusters_config = Uffizzi::ConfigHelper.update_clusters_config_by_id(id, params)
|
85
|
+
ConfigFile.write_option(:clusters, clusters_config)
|
86
|
+
end
|
87
|
+
|
88
|
+
def cluster_creation_params(name, creation_source)
|
89
|
+
oidc_token = Uffizzi::ConfigFile.read_option(:oidc_token)
|
90
|
+
|
91
|
+
{
|
92
|
+
cluster: {
|
93
|
+
name: name,
|
94
|
+
manifest: nil,
|
95
|
+
creation_source: creation_source,
|
96
|
+
},
|
97
|
+
token: oidc_token,
|
98
|
+
}
|
99
|
+
end
|
100
|
+
|
101
|
+
def handle_delete_cluster(cluster_id, cluster_name, kubeconfig)
|
102
|
+
exclude_kubeconfig(cluster_id, kubeconfig) if kubeconfig.present?
|
103
|
+
|
104
|
+
params = {
|
105
|
+
cluster_name: cluster_name,
|
106
|
+
oidc_token: ConfigFile.read_option(:oidc_token),
|
107
|
+
}
|
108
|
+
response = delete_cluster(ConfigFile.read_option(:server), project_slug, params)
|
109
|
+
|
110
|
+
if ResponseHelper.no_content?(response)
|
111
|
+
Uffizzi.ui.say("Cluster #{cluster_name} deleted")
|
112
|
+
else
|
113
|
+
ResponseHelper.handle_failed_response(response)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def exclude_kubeconfig(cluster_id, kubeconfig)
|
118
|
+
cluster_config = Uffizzi::ConfigHelper.cluster_config_by_id(cluster_id)
|
119
|
+
return if cluster_config.nil?
|
120
|
+
|
121
|
+
kubeconfig_path = cluster_config[:kubeconfig_path]
|
122
|
+
ConfigFile.write_option(:clusters, Uffizzi::ConfigHelper.clusters_config_without(cluster_id))
|
123
|
+
|
124
|
+
KubeconfigService.save_to_filepath(kubeconfig_path, kubeconfig) do |kubeconfig_by_path|
|
125
|
+
return if kubeconfig_by_path.nil?
|
126
|
+
|
127
|
+
new_kubeconfig = KubeconfigService.exclude(kubeconfig_by_path, kubeconfig)
|
128
|
+
new_current_context = find_previous_current_context(new_kubeconfig, kubeconfig_path)
|
129
|
+
KubeconfigService.update_current_context(new_kubeconfig, new_current_context)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def find_previous_current_context(kubeconfig, kubeconfig_path)
|
134
|
+
prev_current_context = Uffizzi::ConfigHelper.previous_current_context_by_path(kubeconfig_path)&.fetch(:current_context, nil)
|
135
|
+
|
136
|
+
if KubeconfigService.find_cluster_contexts_by_name(kubeconfig, prev_current_context).present?
|
137
|
+
prev_current_context
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
def save_previous_current_context(kubeconfig_path, current_context)
|
142
|
+
previous_current_contexts = Uffizzi::ConfigHelper.set_previous_current_context_by_path(kubeconfig_path, current_context)
|
143
|
+
ConfigFile.write_option(:previous_current_contexts, previous_current_contexts)
|
144
|
+
end
|
145
|
+
|
146
|
+
def parse_kubeconfig(kubeconfig)
|
147
|
+
return if kubeconfig.nil?
|
148
|
+
|
149
|
+
Psych.safe_load(Base64.decode64(kubeconfig))
|
150
|
+
end
|
151
|
+
|
152
|
+
def launch_scaffold(config_path)
|
153
|
+
Uffizzi.ui.say('Start skaffold')
|
154
|
+
cmd = "skaffold dev --filename='#{config_path}'"
|
155
|
+
|
156
|
+
Uffizzi.ui.popen2e(cmd) do |_stdin, stdout_and_stderr, wait_thr|
|
157
|
+
stdout_and_stderr.each { |l| puts l }
|
158
|
+
wait_thr.value
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def check_skaffold_existence
|
163
|
+
cmd = 'skaffold version'
|
164
|
+
stdout_str, stderr_str = Uffizzi.ui.capture3(cmd)
|
165
|
+
|
166
|
+
return if stdout_str.present? && stderr_str.blank?
|
167
|
+
|
168
|
+
Uffizzi.ui.say_error_and_exit(stderr_str)
|
169
|
+
rescue StandardError => e
|
170
|
+
Uffizzi.ui.say_error_and_exit(e.message)
|
171
|
+
end
|
172
|
+
|
173
|
+
def project_slug
|
174
|
+
@project_slug ||= ConfigFile.read_option(:project)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
data/lib/uffizzi/cli/login.rb
CHANGED
@@ -21,7 +21,7 @@ module Uffizzi
|
|
21
21
|
|
22
22
|
def run
|
23
23
|
AuthHelper.sign_out if AuthHelper.signed_in?
|
24
|
-
return perform_email_login
|
24
|
+
return perform_email_login unless @options[:email].nil?
|
25
25
|
|
26
26
|
perform_browser_login
|
27
27
|
end
|
@@ -45,7 +45,7 @@ module Uffizzi
|
|
45
45
|
def perform_browser_login
|
46
46
|
session_id = SecureRandom.uuid
|
47
47
|
response = create_access_token(@server, session_id)
|
48
|
-
return handle_failed_response(response) unless ResponseHelper.created?(response)
|
48
|
+
return ResponseHelper.handle_failed_response(response) unless ResponseHelper.created?(response)
|
49
49
|
|
50
50
|
url = browser_sign_in_url(@server, session_id)
|
51
51
|
open_browser(url)
|
@@ -68,7 +68,7 @@ module Uffizzi
|
|
68
68
|
token = response[:body][:access_token]
|
69
69
|
Uffizzi::Token.delete
|
70
70
|
Uffizzi::Token.write(token)
|
71
|
-
Uffizzi.ui.say('Login
|
71
|
+
Uffizzi.ui.say('Login successful')
|
72
72
|
|
73
73
|
set_current_account_and_project
|
74
74
|
end
|
@@ -84,7 +84,7 @@ module Uffizzi
|
|
84
84
|
ConfigFile.write_option(:server, @server)
|
85
85
|
ConfigFile.write_option(:username, username)
|
86
86
|
ConfigFile.write_option(:cookie, response[:headers])
|
87
|
-
Uffizzi.ui.say('Login
|
87
|
+
Uffizzi.ui.say('Login successful')
|
88
88
|
|
89
89
|
if ENV.fetch('CI_PIPELINE_RUN', false)
|
90
90
|
account = response[:body][:user][:default_account]
|
data/lib/uffizzi/cli.rb
CHANGED
@@ -19,7 +19,7 @@ module Uffizzi
|
|
19
19
|
desc 'login [OPTIONS]', 'Login to Uffizzi to view and manage your previews'
|
20
20
|
method_option :server, required: false, aliases: '-s'
|
21
21
|
method_option :username, required: false, aliases: '-u'
|
22
|
-
method_option :email, required: false, aliases: '-e'
|
22
|
+
method_option :email, required: false, aliases: '-e', lazy_default: ''
|
23
23
|
def login
|
24
24
|
require_relative 'cli/login'
|
25
25
|
Login.new(options).run
|
@@ -71,6 +71,10 @@ module Uffizzi
|
|
71
71
|
Disconnect.new.run(credential_type)
|
72
72
|
end
|
73
73
|
|
74
|
+
desc 'dev', 'dev'
|
75
|
+
require_relative 'cli/dev'
|
76
|
+
subcommand 'dev', Cli::Dev
|
77
|
+
|
74
78
|
map preview: :compose
|
75
79
|
|
76
80
|
class << self
|
@@ -121,7 +125,7 @@ module Uffizzi
|
|
121
125
|
when Thor::Error
|
122
126
|
raise exception
|
123
127
|
when Interrupt
|
124
|
-
|
128
|
+
nil
|
125
129
|
when StandardError
|
126
130
|
raise Uffizzi::CliError.new(exception.message)
|
127
131
|
else
|
@@ -16,13 +16,14 @@ module Uffizzi
|
|
16
16
|
|
17
17
|
def set_server(options)
|
18
18
|
config_server = ConfigFile.exists? ? Uffizzi::ConfigHelper.read_option_from_config(:server) : nil
|
19
|
-
server_address =
|
19
|
+
server_address = options[:server] || config_server || Uffizzi.configuration.default_server.to_s
|
20
20
|
server_address.start_with?('http:', 'https:') ? server_address : "https://#{server_address}"
|
21
21
|
end
|
22
22
|
|
23
23
|
def set_username(options)
|
24
24
|
config_username = ConfigFile.exists? ? Uffizzi::ConfigHelper.read_option_from_config(:username) : nil
|
25
|
-
options[:
|
25
|
+
options_username = options[:email].present? ? options[:email] : nil
|
26
|
+
options_username || config_username || Uffizzi.ui.ask('Username:')
|
26
27
|
end
|
27
28
|
|
28
29
|
def set_password
|
@@ -9,8 +9,6 @@ class ClusterDisconnectService
|
|
9
9
|
def handle(options)
|
10
10
|
kubeconfig_path = options[:kubeconfig] || KubeconfigService.default_path
|
11
11
|
is_ask_origin_current_context = options[:ask]
|
12
|
-
|
13
|
-
prev_current_context = Uffizzi::ConfigHelper.previous_current_context_by_path(kubeconfig_path)&.fetch(:current_context, nil)
|
14
12
|
kubeconfig = KubeconfigService.read_kubeconfig(kubeconfig_path)
|
15
13
|
|
16
14
|
if kubeconfig.nil?
|
@@ -18,12 +16,14 @@ class ClusterDisconnectService
|
|
18
16
|
end
|
19
17
|
|
20
18
|
contexts = KubeconfigService.get_cluster_contexts(kubeconfig)
|
21
|
-
current_context = KubeconfigService.get_current_context(kubeconfig)
|
22
19
|
|
23
20
|
if contexts.empty?
|
24
21
|
return Uffizzi.ui.say("No contexts by kubeconfig path #{kubeconfig_path}")
|
25
22
|
end
|
26
23
|
|
24
|
+
prev_current_context = Uffizzi::ConfigHelper.previous_current_context_by_path(kubeconfig_path)&.fetch(:current_context, nil)
|
25
|
+
current_context = KubeconfigService.get_current_context(kubeconfig)
|
26
|
+
|
27
27
|
if KubeconfigService.find_cluster_contexts_by_name(kubeconfig, prev_current_context).present? &&
|
28
28
|
prev_current_context != current_context &&
|
29
29
|
!is_ask_origin_current_context
|
@@ -8,6 +8,7 @@ class ClusterService
|
|
8
8
|
CLUSTER_STATE_DEPLOYED = 'deployed'
|
9
9
|
CLUSTER_STATE_FAILED_DEPLOY_NAMESPACE = 'failed_deploy_namespace'
|
10
10
|
CLUSTER_STATE_FAILED = 'failed'
|
11
|
+
CLUSTER_NAME_MAX_LENGTH = 15
|
11
12
|
|
12
13
|
class << self
|
13
14
|
include ApiClient
|
@@ -42,7 +43,7 @@ class ClusterService
|
|
42
43
|
end
|
43
44
|
|
44
45
|
def generate_name
|
45
|
-
name =
|
46
|
+
name = Faker::Internet.domain_word[0..CLUSTER_NAME_MAX_LENGTH]
|
46
47
|
|
47
48
|
return name if valid_name?(name)
|
48
49
|
|
data/lib/uffizzi/shell.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'awesome_print'
|
4
|
+
require 'open3'
|
4
5
|
|
5
6
|
module Uffizzi
|
6
7
|
module UI
|
@@ -54,6 +55,14 @@ module Uffizzi
|
|
54
55
|
$stdout.stat.pipe?
|
55
56
|
end
|
56
57
|
|
58
|
+
def popen2e(command, &block)
|
59
|
+
Open3.popen2e(command, &block)
|
60
|
+
end
|
61
|
+
|
62
|
+
def capture3(command)
|
63
|
+
Open3.capture3(command)
|
64
|
+
end
|
65
|
+
|
57
66
|
private
|
58
67
|
|
59
68
|
def format_to_json(data)
|
data/lib/uffizzi/version.rb
CHANGED
data/man/uffizzi-cluster-create
CHANGED
@@ -5,19 +5,21 @@
|
|
5
5
|
\fBuffizzi\-cluster\-create\fR \- create a cluster
|
6
6
|
.SH "SYNOPSIS"
|
7
7
|
.nf
|
8
|
-
uffizzi cluster create
|
8
|
+
uffizzi cluster create [CLUSTER_NAME]
|
9
9
|
.fi
|
10
10
|
.SH "DESCRIPTION"
|
11
11
|
.nf
|
12
|
-
Creates a new cluster\.
|
12
|
+
Creates a new cluster\. If no CLUSTER_NAME is specified,
|
13
|
+
the cluster is created with the auto generated name\.
|
13
14
|
|
14
15
|
For more information on Uffizzi clusters, see:
|
15
16
|
https://docs\.uffizzi\.com/references/cli/
|
16
17
|
.fi
|
17
18
|
.SH "FLAGS"
|
18
19
|
.nf
|
19
|
-
\-\-name
|
20
|
-
|
20
|
+
\-\-name
|
21
|
+
Option is deprecated and will be removed in the newer versions\.
|
22
|
+
Please use a positional argument instead: uffizzi cluster create my\-awesome\-name\.
|
21
23
|
|
22
24
|
\-\-kubeconfig="/path/to/your/kubeconfig"
|
23
25
|
Path to kubeconfig file
|
@@ -27,6 +29,7 @@ https://docs\.uffizzi\.com/references/cli/
|
|
27
29
|
|
28
30
|
\-\-update\-current\-context
|
29
31
|
Update current\-context in kubeconfig file
|
32
|
+
Default is true
|
30
33
|
|
31
34
|
\-\-output=pretty\-json
|
32
35
|
\-\-output=json
|
@@ -40,10 +43,10 @@ To create a cluster with the auto generated name, run:
|
|
40
43
|
|
41
44
|
To create a cluster with name, run:
|
42
45
|
|
43
|
-
$ uffizzi cluster create
|
46
|
+
$ uffizzi cluster create my\-cluster
|
44
47
|
|
45
48
|
To create a cluster from a manifests directory, run:
|
46
49
|
|
47
|
-
$ uffizzi cluster create
|
50
|
+
$ uffizzi cluster create my\-cluster \-\-manifest=manifests/
|
48
51
|
.fi
|
49
52
|
|
@@ -2,17 +2,19 @@ uffizzi-cluster-create - create a cluster
|
|
2
2
|
================================================================
|
3
3
|
|
4
4
|
## SYNOPSIS
|
5
|
-
uffizzi cluster create
|
5
|
+
uffizzi cluster create [CLUSTER_NAME]
|
6
6
|
|
7
7
|
## DESCRIPTION
|
8
|
-
Creates a new cluster.
|
8
|
+
Creates a new cluster. If no CLUSTER_NAME is specified,
|
9
|
+
the cluster is created with the auto generated name.
|
9
10
|
|
10
11
|
For more information on Uffizzi clusters, see:
|
11
12
|
https://docs.uffizzi.com/references/cli/
|
12
13
|
|
13
14
|
## FLAGS
|
14
|
-
--name
|
15
|
-
|
15
|
+
--name
|
16
|
+
Option is deprecated and will be removed in the newer versions.
|
17
|
+
Please use a positional argument instead: uffizzi cluster create my-awesome-name.
|
16
18
|
|
17
19
|
--kubeconfig="/path/to/your/kubeconfig"
|
18
20
|
Path to kubeconfig file
|
@@ -22,6 +24,7 @@ uffizzi-cluster-create - create a cluster
|
|
22
24
|
|
23
25
|
--update-current-context
|
24
26
|
Update current-context in kubeconfig file
|
27
|
+
Default is true
|
25
28
|
|
26
29
|
--output=pretty-json
|
27
30
|
--output=json
|
@@ -34,8 +37,8 @@ uffizzi-cluster-create - create a cluster
|
|
34
37
|
|
35
38
|
To create a cluster with name, run:
|
36
39
|
|
37
|
-
$ uffizzi cluster create
|
40
|
+
$ uffizzi cluster create my-cluster
|
38
41
|
|
39
42
|
To create a cluster from a manifests directory, run:
|
40
43
|
|
41
|
-
$ uffizzi cluster create
|
44
|
+
$ uffizzi cluster create my-cluster --manifest=manifests/
|
data/man/uffizzi-cluster-delete
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with Ronn-NG/v0.9.1
|
2
2
|
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
3
|
-
.TH "UFFIZZI\-CLUSTER\-DELETE" "" "
|
3
|
+
.TH "UFFIZZI\-CLUSTER\-DELETE" "" "September 2023" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBuffizzi\-cluster\-delete\fR \- delete a cluster
|
6
6
|
.SH "SYNOPSIS"
|
@@ -23,6 +23,12 @@ https://docs\.uffizzi\.com/references/cli/
|
|
23
23
|
[CLUSTER_NAME]
|
24
24
|
Name for the cluster you want to delete\.
|
25
25
|
.fi
|
26
|
+
.SH "FLAGS"
|
27
|
+
.nf
|
28
|
+
\-\-delete\-config=false
|
29
|
+
Delete cluster from kubeconfig\.
|
30
|
+
Default is true\.
|
31
|
+
.fi
|
26
32
|
.SH "EXAMPLES"
|
27
33
|
.nf
|
28
34
|
The following command deletes the cluster with CLUSTER_NAME my\-cluster:
|
@@ -18,6 +18,11 @@ uffizzi-cluster-delete - delete a cluster
|
|
18
18
|
[CLUSTER_NAME]
|
19
19
|
Name for the cluster you want to delete.
|
20
20
|
|
21
|
+
## FLAGS
|
22
|
+
--delete-config=false
|
23
|
+
Delete cluster from kubeconfig.
|
24
|
+
Default is true.
|
25
|
+
|
21
26
|
## EXAMPLES
|
22
27
|
The following command deletes the cluster with CLUSTER_NAME my-cluster:
|
23
28
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
3
3
|
.TH "UFFIZZI\-CLUSTER\-DISCONNECT" "" "September 2023" ""
|
4
4
|
.SH "NAME"
|
5
|
-
\fBuffizzi\-cluster\-disconnect\fR \- disconnect from current cluster
|
5
|
+
\fBuffizzi\-cluster\-disconnect\fR \- disconnect from current cluster context
|
6
6
|
.SH "SYNOPSIS"
|
7
7
|
.nf
|
8
8
|
uffizzi cluster disconnect
|
@@ -17,7 +17,7 @@ https://docs\.uffizzi\.com/references/cli/
|
|
17
17
|
.SH "FLAGS"
|
18
18
|
.nf
|
19
19
|
\-\-ask
|
20
|
-
Show list available contexts for kubeconfig
|
20
|
+
Show list available contexts for kubeconfig and set new origin current context
|
21
21
|
|
22
22
|
\-\-kubeconfig="/path/to/your/kubeconfig"
|
23
23
|
Path to kubeconfig file
|
@@ -0,0 +1,29 @@
|
|
1
|
+
.\" generated with Ronn-NG/v0.9.1
|
2
|
+
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
3
|
+
.TH "UFFIZZI\-DEV\-START" "" "September 2023" ""
|
4
|
+
.SH "NAME"
|
5
|
+
\fBuffizzi\-dev\-start\fR \- start development environment
|
6
|
+
.SH "SYNOPSIS"
|
7
|
+
.nf
|
8
|
+
uffizzi dev start [SKAFFOLD_CONFIG_FILE_PATH]
|
9
|
+
.fi
|
10
|
+
.SH "DESCRIPTION"
|
11
|
+
.nf
|
12
|
+
Creates a new cluster and start skaffold\. If no SKAFFOLD_CONFIG_FILE_PATH is specified,
|
13
|
+
the default path will be used\.
|
14
|
+
Default SKAFFOLD_CONFIG_FILE_PATH is \'skaffold\.yaml\'
|
15
|
+
|
16
|
+
For more information on Uffizzi clusters, see:
|
17
|
+
https://docs\.uffizzi\.com/references/cli/
|
18
|
+
.fi
|
19
|
+
.SH "EXAMPLES"
|
20
|
+
.nf
|
21
|
+
To start development environment, run:
|
22
|
+
|
23
|
+
$ uffizzi dev start
|
24
|
+
|
25
|
+
To start development environment with custom skaffold\.yaml file, run:
|
26
|
+
|
27
|
+
$ uffizzi cluster create /path/to/skaffold\.yaml
|
28
|
+
.fi
|
29
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
uffizzi-dev-start - start development environment
|
2
|
+
================================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
uffizzi dev start [SKAFFOLD_CONFIG_FILE_PATH]
|
6
|
+
|
7
|
+
## DESCRIPTION
|
8
|
+
Creates a new cluster and start skaffold. If no SKAFFOLD_CONFIG_FILE_PATH is specified,
|
9
|
+
the default path will be used.
|
10
|
+
Default SKAFFOLD_CONFIG_FILE_PATH is 'skaffold.yaml'
|
11
|
+
|
12
|
+
For more information on Uffizzi clusters, see:
|
13
|
+
https://docs.uffizzi.com/references/cli/
|
14
|
+
|
15
|
+
## EXAMPLES
|
16
|
+
To start development environment, run:
|
17
|
+
|
18
|
+
$ uffizzi dev start
|
19
|
+
|
20
|
+
To start development environment with custom skaffold.yaml file, run:
|
21
|
+
|
22
|
+
$ uffizzi cluster create /path/to/skaffold.yaml
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uffizzi-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Thurman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-09-
|
12
|
+
date: 2023-09-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -423,6 +423,7 @@ files:
|
|
423
423
|
- lib/uffizzi/cli/common.rb
|
424
424
|
- lib/uffizzi/cli/config.rb
|
425
425
|
- lib/uffizzi/cli/connect.rb
|
426
|
+
- lib/uffizzi/cli/dev.rb
|
426
427
|
- lib/uffizzi/cli/disconnect.rb
|
427
428
|
- lib/uffizzi/cli/login.rb
|
428
429
|
- lib/uffizzi/cli/login_by_identity_token.rb
|
@@ -518,6 +519,8 @@ files:
|
|
518
519
|
- man/uffizzi-connect-ghcr
|
519
520
|
- man/uffizzi-connect-ghcr.ronn
|
520
521
|
- man/uffizzi-connect.ronn
|
522
|
+
- man/uffizzi-dev-start
|
523
|
+
- man/uffizzi-dev-start.ronn
|
521
524
|
- man/uffizzi-disconnect
|
522
525
|
- man/uffizzi-disconnect.ronn
|
523
526
|
- man/uffizzi-login
|