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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0dca2ba03ac849c8e1ca71bac3c495b698fda210f888320b06bbac114eb2168
4
- data.tar.gz: 1441cff7ebd668159423966a6b5a9604e8e377a45f8d027802c381814e297d1d
3
+ metadata.gz: 2f954b8f82aabbd435972f10d4070dc9463642d8d23702a80f6897e8bce74cfe
4
+ data.tar.gz: 53ec7b439ed075e8582ed208b5a1ab5a03cbfe4e8bc6e79b8e4abaaf76ae2ada
5
5
  SHA512:
6
- metadata.gz: 310e1accb7217654da0e8d4f84364c2db240495d5c5d4df602f63a8ad87b72c798b8151817a44a95224599dfd312bd83875fd7a36e4430bb1aefdcbd5425a9f0
7
- data.tar.gz: 262191965e225983bf075b45a878c49953f4f3955da4628ff64a39b5bc1641182e954a2c6d8bbc4a2808e3f4ba1382edc9b8cacfa36ac0d7de8db3bdf610c41a
6
+ metadata.gz: e60cab6e8a4b07c6c1871e31d15d9b27544bf800cc5c461515d69289cc579a96f3291b704a70347bb3d492bb64cb68eae761f0b31b70fc103d2eb4573441cd94
7
+ data.tar.gz: e9c0eb113223ff5aeda960f6f55f5e63a5057912ea663ee8cbb5b45e4ff99ff47603818d1d48c09b355bf3e43ea3780f255a370e5ef11e48683b81a075a9e1b9
@@ -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]
@@ -11,7 +11,7 @@ module Uffizzi
11
11
 
12
12
  default_task :controller
13
13
 
14
- desc 'controller [HOSTNMAE]', 'Install uffizzi controller to cluster'
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 = "\r\n"\
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
@@ -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, Uffizzi::ConfigHelper.account_config(current_account[:id], current_account[:name]))
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
- account_name = accounts.detect { |account| account[:id] == account_id }[:name]
135
+ selected_account = accounts.detect { |account| account[:id] == account_id }
135
136
 
136
- ConfigFile.write_option(:account, Uffizzi::ConfigHelper.account_config(account_id, account_name))
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
 
@@ -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
- return ConfigFile.write_option(:account, Uffizzi::ConfigHelper.account_config(account[:id], account[:name])) if account
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 [HOSTNMAE]', 'Install uffizzi controller to cluster'
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, name = nil)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uffizzi
4
- VERSION = '2.4.4'
4
+ VERSION = '2.4.6'
5
5
  end
@@ -1,52 +1,55 @@
1
- $ uffizzi -h
2
- uffizzi - manage Uffizzi resources
1
+ $ uffizzi install help
2
+ uffizzi-install - install the uffizzi platform
3
3
  ================================================================
4
4
 
5
5
  ## SYNOPSIS
6
- uffizzi GROUP | COMMAND
6
+ uffizzi install [HOSTNAME] --email=[EMAIL]
7
7
 
8
8
  ## DESCRIPTION
9
- The uffizzi CLI manages authentication, configuration, and
10
- interaction with Uffizzi APIs.
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 uffizzi CLI, see:
13
- https://docs.uffizzi.com/references/cli/
14
+ For more information on the Uffizzi installation process, see:
15
+ https://docs.uffizzi.com/install/platform
14
16
 
15
- ## GROUP
16
- GROUP is one of the following:
17
- cluster
18
- Manage virtual clusters
17
+ ## POSITIONAL ARGUMENTS
19
18
 
20
- config
21
- Configure the uffizzi CLI
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
- connect
24
- Grant a Uffizzi user account access to external services
27
+ EMAIL
28
+ A business email, required for letsencrypt certificate authority.
25
29
 
26
- compose
27
- Manage Uffizzi compose environments (previews) and view logs
30
+ ## FLAGS
28
31
 
29
- dev
30
- Creates a Uffizzi cluster preconfigured for development workflows
32
+ --email
33
+ A business email required for letsencrypt
31
34
 
32
- install
33
- Install the Uffizzi platform data plane on a host cluster.
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
- project
36
- Manage Uffizzi project resources including compose files for
37
- specifying compose environment (preview) configurations and secrets
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
- ## COMMAND
40
- COMMAND is one of the following:
43
+ --help
44
+ Display this help page and exit
41
45
 
42
- help
43
- Show uffizzi documentation
46
+ ## EXAMPLES
44
47
 
45
- login
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
- logout
49
- Log out of a Uffizzi user account
50
-
51
- version
52
- Print version information for uffizzi CLI
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
- dev
33
- Creates a Uffizzi cluster preconfigured for development workflows
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
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: 2023-12-29 00:00:00.000000000 Z
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