uffizzi-cli 2.4.4 → 2.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uffizzi/cli/account.rb +1 -1
- data/lib/uffizzi/cli/install.rb +26 -14
- data/lib/uffizzi/cli/login.rb +37 -4
- data/lib/uffizzi/cli/login_by_identity_token.rb +1 -1
- data/lib/uffizzi/cli/project.rb +3 -2
- data/lib/uffizzi/cli/uninstall.rb +1 -1
- data/lib/uffizzi/helpers/config_helper.rb +6 -2
- data/lib/uffizzi/version.rb +1 -1
- data/man/uffizzi-install.ronn +38 -35
- data/man/uffizzi-uninstall.ronn +23 -0
- data/man/uffizzi.ronn +9 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f954b8f82aabbd435972f10d4070dc9463642d8d23702a80f6897e8bce74cfe
|
4
|
+
data.tar.gz: 53ec7b439ed075e8582ed208b5a1ab5a03cbfe4e8bc6e79b8e4abaaf76ae2ada
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e60cab6e8a4b07c6c1871e31d15d9b27544bf800cc5c461515d69289cc579a96f3291b704a70347bb3d492bb64cb68eae761f0b31b70fc103d2eb4573441cd94
|
7
|
+
data.tar.gz: e9c0eb113223ff5aeda960f6f55f5e63a5057912ea663ee8cbb5b45e4ff99ff47603818d1d48c09b355bf3e43ea3780f255a370e5ef11e48683b81a075a9e1b9
|
data/lib/uffizzi/cli/account.rb
CHANGED
@@ -76,7 +76,7 @@ module Uffizzi
|
|
76
76
|
account = response[:body][:account]
|
77
77
|
account_id = account[:id]
|
78
78
|
account_name = account[:name]
|
79
|
-
ConfigFile.write_option(:account, Uffizzi::ConfigHelper.account_config(account_id, account_name))
|
79
|
+
ConfigFile.write_option(:account, Uffizzi::ConfigHelper.account_config(id: account_id, name: account_name))
|
80
80
|
Uffizzi.ui.say("The account with name '#{account_name}' was set as default.")
|
81
81
|
|
82
82
|
projects = account[:projects]
|
data/lib/uffizzi/cli/install.rb
CHANGED
@@ -11,7 +11,7 @@ module Uffizzi
|
|
11
11
|
|
12
12
|
default_task :controller
|
13
13
|
|
14
|
-
desc 'controller [
|
14
|
+
desc 'controller [HOSTNAME]', 'Install uffizzi controller to cluster'
|
15
15
|
method_option :namespace, type: :string
|
16
16
|
method_option :email, type: :string, required: true
|
17
17
|
method_option :context, type: :string
|
@@ -20,14 +20,14 @@ module Uffizzi
|
|
20
20
|
def controller(hostname)
|
21
21
|
Uffizzi::AuthHelper.check_login
|
22
22
|
|
23
|
-
InstallService.kubectl_exists?
|
24
|
-
InstallService.helm_exists?
|
23
|
+
# InstallService.kubectl_exists?
|
24
|
+
# InstallService.helm_exists?
|
25
25
|
|
26
26
|
if options[:context].present? && options[:context] != InstallService.kubeconfig_current_context
|
27
27
|
InstallService.set_current_context(options[:context])
|
28
28
|
end
|
29
29
|
|
30
|
-
ask_confirmation
|
30
|
+
ask_confirmation(options[:namespace])
|
31
31
|
|
32
32
|
uri = parse_hostname(hostname)
|
33
33
|
installation_options = build_installation_options(uri)
|
@@ -159,16 +159,8 @@ module Uffizzi
|
|
159
159
|
update_controller_settings(existing_controller_setting[:id], controller_setting_params)
|
160
160
|
end
|
161
161
|
|
162
|
-
def ask_confirmation
|
163
|
-
msg =
|
164
|
-
'This command will install Uffizzi into the default namespace of'\
|
165
|
-
" the '#{InstallService.kubeconfig_current_context}' context."\
|
166
|
-
"\r\n"\
|
167
|
-
"To install in a different place, use options '--namespace' and/or '--context'."\
|
168
|
-
"\r\n\r\n"\
|
169
|
-
"After installation, new environments created for account '#{account_name}' will be deployed to this host cluster."\
|
170
|
-
"\r\n\r\n"
|
171
|
-
|
162
|
+
def ask_confirmation(namespace)
|
163
|
+
msg = namespace.present? ? custom_namespace_installation_message(namespace) : default_installation_message
|
172
164
|
Uffizzi.ui.say(msg)
|
173
165
|
|
174
166
|
question = 'Okay to proceed?'
|
@@ -263,5 +255,25 @@ module Uffizzi
|
|
263
255
|
def existing_controller_setting
|
264
256
|
@existing_controller_setting ||= fetch_controller_settings[0]
|
265
257
|
end
|
258
|
+
|
259
|
+
def default_installation_message
|
260
|
+
"\r\n"\
|
261
|
+
"This command will install Uffizzi into the 'default' namespace of"\
|
262
|
+
" the '#{InstallService.kubeconfig_current_context}' context."\
|
263
|
+
"\r\n"\
|
264
|
+
"To install in a different place, use options '--namespace' and/or '--context'."\
|
265
|
+
"\r\n\r\n"\
|
266
|
+
"After installation, new environments created for account '#{account_name}' will be deployed to this host cluster."\
|
267
|
+
"\r\n\r\n"
|
268
|
+
end
|
269
|
+
|
270
|
+
def custom_namespace_installation_message(namespace)
|
271
|
+
"\r\n"\
|
272
|
+
"This command will install Uffizzi into the '#{namespace}' namespace of"\
|
273
|
+
" the '#{InstallService.kubeconfig_current_context}' context."\
|
274
|
+
"\r\n\r\n"\
|
275
|
+
"After installation, new environments created for account '#{account_name}' will be deployed to this host cluster."\
|
276
|
+
"\r\n\r\n"
|
277
|
+
end
|
266
278
|
end
|
267
279
|
end
|
data/lib/uffizzi/cli/login.rb
CHANGED
@@ -71,6 +71,7 @@ module Uffizzi
|
|
71
71
|
Uffizzi.ui.say('Login successful')
|
72
72
|
|
73
73
|
set_current_account_and_project
|
74
|
+
Uffizzi.ui.say(installation_message)
|
74
75
|
end
|
75
76
|
|
76
77
|
def open_browser(url)
|
@@ -88,7 +89,7 @@ module Uffizzi
|
|
88
89
|
|
89
90
|
if ENV.fetch('CI_PIPELINE_RUN', false)
|
90
91
|
account = response[:body][:user][:default_account]
|
91
|
-
return ConfigFile.write_option(:account, Uffizzi::ConfigHelper.account_config(account[:id]))
|
92
|
+
return ConfigFile.write_option(:account, Uffizzi::ConfigHelper.account_config(id: account[:id]))
|
92
93
|
end
|
93
94
|
|
94
95
|
set_current_account_and_project
|
@@ -123,7 +124,7 @@ module Uffizzi
|
|
123
124
|
accounts = accounts_response[:body][:accounts]
|
124
125
|
if accounts.length == 1
|
125
126
|
current_account = accounts.first
|
126
|
-
ConfigFile.write_option(:account,
|
127
|
+
ConfigFile.write_option(:account, account_config(current_account))
|
127
128
|
return current_account[:id]
|
128
129
|
end
|
129
130
|
question = 'Select an account:'
|
@@ -131,9 +132,9 @@ module Uffizzi
|
|
131
132
|
{ name: account[:name], value: account[:id] }
|
132
133
|
end
|
133
134
|
account_id = Uffizzi.prompt.select(question, choices)
|
134
|
-
|
135
|
+
selected_account = accounts.detect { |account| account[:id] == account_id }
|
135
136
|
|
136
|
-
ConfigFile.write_option(:account,
|
137
|
+
ConfigFile.write_option(:account, account_config(selected_account))
|
137
138
|
|
138
139
|
account_id
|
139
140
|
end
|
@@ -211,5 +212,37 @@ module Uffizzi
|
|
211
212
|
|
212
213
|
Uffizzi.ui.say("Project #{project[:name]} was successfully created")
|
213
214
|
end
|
215
|
+
|
216
|
+
def installation_message
|
217
|
+
account_config = ConfigHelper.read_account_config
|
218
|
+
if account_config[:has_installation]
|
219
|
+
"\r\n\r\n"\
|
220
|
+
'####################################################################' \
|
221
|
+
"\r\n\r\n"\
|
222
|
+
"Your CLI is configured to use '#{account_config[:vclusters_controller_url]}'." \
|
223
|
+
"\r\n\r\n"\
|
224
|
+
'Run `uffizzi config -h` to see CLI configuration options.'\
|
225
|
+
"\r\n\r\n"
|
226
|
+
else
|
227
|
+
"\r\n\r\n"\
|
228
|
+
'####################################################################'\
|
229
|
+
"\r\n\r\n"\
|
230
|
+
'Your CLI is configured to use https://app.uffizzi.com (Uffizzi Cloud).'\
|
231
|
+
"\r\n\r\n"\
|
232
|
+
'Run `uffizzi config -h` to see CLI configuration options.'\
|
233
|
+
"\r\n"\
|
234
|
+
'Run `uffizzi install -h` to see self-hosted installation options.'\
|
235
|
+
"\r\n\r\n"
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
def account_config(account_data)
|
240
|
+
Uffizzi::ConfigHelper.account_config(
|
241
|
+
id: account_data[:id],
|
242
|
+
name: account_data[:name],
|
243
|
+
has_installation: account_data[:has_installation],
|
244
|
+
vclusters_controller_url: account_data[:vclusters_controller_url],
|
245
|
+
)
|
246
|
+
end
|
214
247
|
end
|
215
248
|
end
|
@@ -41,7 +41,7 @@ module Uffizzi
|
|
41
41
|
def handle_succeed_response(response, server, oidc_token)
|
42
42
|
ConfigFile.write_option(:server, server)
|
43
43
|
ConfigFile.write_option(:cookie, response[:headers])
|
44
|
-
ConfigFile.write_option(:account, Uffizzi::ConfigHelper.account_config(response[:body][:account_id]))
|
44
|
+
ConfigFile.write_option(:account, Uffizzi::ConfigHelper.account_config(id: response[:body][:account_id]))
|
45
45
|
ConfigFile.write_option(:project, response[:body][:project_slug])
|
46
46
|
ConfigFile.write_option(:oidc_token, oidc_token)
|
47
47
|
|
data/lib/uffizzi/cli/project.rb
CHANGED
@@ -171,10 +171,11 @@ module Uffizzi
|
|
171
171
|
def set_default_project(project)
|
172
172
|
ConfigFile.write_option(:project, project[:slug])
|
173
173
|
account = project[:account]
|
174
|
-
|
174
|
+
account_config = Uffizzi::ConfigHelper.account_config(id: account[:id], name: account[:name])
|
175
|
+
return ConfigFile.write_option(:account, account_config) if account
|
175
176
|
|
176
177
|
# For core versions < core_v2.2.3
|
177
|
-
ConfigFile.write_option(:account, Uffizzi::ConfigHelper.account_config(project[:account_id]))
|
178
|
+
ConfigFile.write_option(:account, Uffizzi::ConfigHelper.account_config(id: project[:account_id]))
|
178
179
|
end
|
179
180
|
end
|
180
181
|
end
|
@@ -11,7 +11,7 @@ module Uffizzi
|
|
11
11
|
|
12
12
|
default_task :controller
|
13
13
|
|
14
|
-
desc 'controller [
|
14
|
+
desc 'controller [HOSTNAME]', 'Install uffizzi controller to cluster'
|
15
15
|
method_option :namespace, type: :string
|
16
16
|
method_option :context, type: :string
|
17
17
|
def controller
|
@@ -17,8 +17,8 @@ module Uffizzi
|
|
17
17
|
ConfigFile.option_has_value?(option) ? ConfigFile.read_option(option) : nil
|
18
18
|
end
|
19
19
|
|
20
|
-
def account_config(id
|
21
|
-
{ id: id, name: name }
|
20
|
+
def account_config(id:, name: nil, has_installation: false, vclusters_controller_url: nil)
|
21
|
+
{ id: id, name: name, has_installation: has_installation, vclusters_controller_url: vclusters_controller_url }
|
22
22
|
end
|
23
23
|
|
24
24
|
def update_clusters_config_by_id(id, params)
|
@@ -60,6 +60,10 @@ module Uffizzi
|
|
60
60
|
read_option_from_config(:dev_environment) || {}
|
61
61
|
end
|
62
62
|
|
63
|
+
def read_account_config
|
64
|
+
read_option_from_config(:account)
|
65
|
+
end
|
66
|
+
|
63
67
|
private
|
64
68
|
|
65
69
|
def clusters
|
data/lib/uffizzi/version.rb
CHANGED
data/man/uffizzi-install.ronn
CHANGED
@@ -1,52 +1,55 @@
|
|
1
|
-
$ uffizzi
|
2
|
-
uffizzi -
|
1
|
+
$ uffizzi install help
|
2
|
+
uffizzi-install - install the uffizzi platform
|
3
3
|
================================================================
|
4
4
|
|
5
5
|
## SYNOPSIS
|
6
|
-
uffizzi
|
6
|
+
uffizzi install [HOSTNAME] --email=[EMAIL]
|
7
7
|
|
8
8
|
## DESCRIPTION
|
9
|
-
|
10
|
-
|
9
|
+
Install the Uffizzi platform data plane (controller and operator) on a host cluster.
|
10
|
+
|
11
|
+
If you want to self-host the Uffizzi platform data and control planes, you should
|
12
|
+
use Uffizzi Enterprise instead. Contact sales@uffizzi.com to get started.
|
11
13
|
|
12
|
-
For more information on the
|
13
|
-
https://docs.uffizzi.com/
|
14
|
+
For more information on the Uffizzi installation process, see:
|
15
|
+
https://docs.uffizzi.com/install/platform
|
14
16
|
|
15
|
-
##
|
16
|
-
GROUP is one of the following:
|
17
|
-
cluster
|
18
|
-
Manage virtual clusters
|
17
|
+
## POSITIONAL ARGUMENTS
|
19
18
|
|
20
|
-
|
21
|
-
|
19
|
+
HOSTNAME
|
20
|
+
The hostname where your installation will be publicly available. E.g. uffizzi.example.com
|
21
|
+
The output of the `install` command is an IP address or hostname where your instance
|
22
|
+
of the Uffizzi controller service is available. Uffizzi expects this service to be publicly
|
23
|
+
available at the specified HOSTNAME. Before you can create Uffizzi environments
|
24
|
+
on your installation, be sure to configure your DNS to point HOSTNAME to the IP
|
25
|
+
or hostname output by this command.
|
22
26
|
|
23
|
-
|
24
|
-
|
27
|
+
EMAIL
|
28
|
+
A business email, required for letsencrypt certificate authority.
|
25
29
|
|
26
|
-
|
27
|
-
Manage Uffizzi compose environments (previews) and view logs
|
30
|
+
## FLAGS
|
28
31
|
|
29
|
-
|
30
|
-
|
32
|
+
--email
|
33
|
+
A business email required for letsencrypt
|
31
34
|
|
32
|
-
|
33
|
-
|
35
|
+
--context
|
36
|
+
The name of the kubeconfig context to use. If no context is specified, your
|
37
|
+
kubeconfig current context is used.
|
34
38
|
|
35
|
-
|
36
|
-
|
37
|
-
|
39
|
+
--namespace
|
40
|
+
The namespace where Uffizzi platform will be installed. If no namespace is
|
41
|
+
specified, the 'default' namespace is used.
|
38
42
|
|
39
|
-
|
40
|
-
|
43
|
+
--help
|
44
|
+
Display this help page and exit
|
41
45
|
|
42
|
-
|
43
|
-
Show uffizzi documentation
|
46
|
+
## EXAMPLES
|
44
47
|
|
45
|
-
|
46
|
-
Log in to a Uffizzi user account
|
48
|
+
To install Uffizzi using the current context at hostname 'uffizzi.example.com', run:
|
47
49
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
$ uffizzi install uffizzi.example.com --email="jdoe@example.com"
|
51
|
+
|
52
|
+
To install Uffizzi using context 'foo' and namespace 'bar', run:
|
53
|
+
|
54
|
+
$ uffizzi install uffizzi.example.com --email="jdoe@example.com" \
|
55
|
+
--context='foo' --namespace='bar'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
$ uffizzi uninstall help
|
2
|
+
uffizzi-uninstall - uninstall the uffizzi platform
|
3
|
+
================================================================
|
4
|
+
|
5
|
+
## SYNOPSIS
|
6
|
+
uffizzi uninstall
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
Uninstall the Uffizzi platform data plane (controller and operator) from a host cluster.
|
10
|
+
|
11
|
+
For more information on the Uffizzi installation process, see:
|
12
|
+
https://docs.uffizzi.com/install/platform
|
13
|
+
|
14
|
+
## FLAGS
|
15
|
+
|
16
|
+
--help
|
17
|
+
Display this help page and exit
|
18
|
+
|
19
|
+
## EXAMPLES
|
20
|
+
|
21
|
+
To uninstall Uffizzi, run:
|
22
|
+
|
23
|
+
$ uffizzi uninstall
|
data/man/uffizzi.ronn
CHANGED
@@ -25,12 +25,19 @@ uffizzi - manage Uffizzi resources
|
|
25
25
|
compose
|
26
26
|
Manage Uffizzi compose environments (previews) and view logs
|
27
27
|
|
28
|
+
dev
|
29
|
+
Creates a Uffizzi cluster preconfigured for development workflows
|
30
|
+
|
31
|
+
install
|
32
|
+
Install the Uffizzi platform data plane on a host cluster.
|
33
|
+
|
28
34
|
project
|
29
35
|
Manage Uffizzi project resources including compose files for
|
30
36
|
specifying compose environment (preview) configurations and secrets
|
31
37
|
|
32
|
-
|
33
|
-
|
38
|
+
uninstall
|
39
|
+
Uninstall the Uffizzi platform data plane from a host cluster. Updates CLI
|
40
|
+
to use Uffizzi Cloud as the default API.
|
34
41
|
|
35
42
|
## COMMAND
|
36
43
|
COMMAND is one of the following:
|
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.4.
|
4
|
+
version: 2.4.6
|
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:
|
12
|
+
date: 2024-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -611,6 +611,7 @@ files:
|
|
611
611
|
- man/uffizzi-project-set-default.ronn
|
612
612
|
- man/uffizzi-project.html
|
613
613
|
- man/uffizzi-project.ronn
|
614
|
+
- man/uffizzi-uninstall.ronn
|
614
615
|
- man/uffizzi.html
|
615
616
|
- man/uffizzi.ronn
|
616
617
|
homepage: https://uffizzi.com
|