neetodeploy 1.0.6 → 1.0.7

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: 38aaafe1332d72299302a1e8e23b51c9bb331247855747ff89447a78e096c3db
4
- data.tar.gz: de0682177ba35603b9a324557a7e3a1447595815895d01ce0b02790991e74236
3
+ metadata.gz: 57fdd1e09457ce272efda43c36489b14a986c28541901a1f2663a69e8252d89f
4
+ data.tar.gz: 1f7db1e2c215d6b169cf93833972f510b349e27a55a137bac87b22441c70bbb2
5
5
  SHA512:
6
- metadata.gz: 61c4a3349bdcb2adea201d5df0111a4299532b4693280ad59466b827d0b6b6f4e96133671d65933de9ef9e1f06a04a63dcc89afca2dda50b0f41fd9db2aea4b6
7
- data.tar.gz: 76de2334e8b337aff37239e8e167e27e05d75a6a6112e3b15e6e9480229a9c1d22ccc1dd9b70c6124408578f336df1047b6a25909bacbb43c6cd51e29828896b
6
+ metadata.gz: d7101aaa85fc0971619183648796c7e32f6df52f3a801c8fd6da8fcc61c9b6c1a36870113098287af5eb378cd44b7626a0a223006e0dbe4f009758df93a1c389
7
+ data.tar.gz: 312db594539b397fb47b89068707d8bdb6b9f1731aa23c61feff362564a68af1016241d4169f3bb6943e1ed04037387d0759136cfa3fe4a3ab89b0f131dbd718
@@ -5,7 +5,7 @@ require_relative "../version"
5
5
 
6
6
  module NeetoDeploy
7
7
  class CLI
8
- NEETO_DEPLOY_HOST = ENV["NEETO_DEPLOY_HOST"] || "https://neeto-engineering.neetodeploy.net" # TODO make this org generic
8
+ NEETO_DEPLOY_HOST = ENV["NEETO_DEPLOY_HOST"] || "https://app.neetodeploy.net"
9
9
  NEETO_DEPLOY_CLI_API_BASE_URL = "#{NEETO_DEPLOY_HOST}/api/cli/#{CLI_API_VERSION}"
10
10
 
11
11
  CLI_CONFIG_DIR = "~/.config/neetodeploy".freeze
@@ -12,10 +12,11 @@ module NeetoDeploy
12
12
  class Base < CLI::Base
13
13
  include Constants
14
14
 
15
- attr_accessor :login_token
15
+ attr_accessor :login_token, :org_subdomain
16
16
 
17
17
  def process!
18
18
  init_session
19
+ ask_for_org_subdomain
19
20
  show_login_link_and_open_in_browser
20
21
  wait_until_user_authenticates!
21
22
  end
@@ -27,14 +28,27 @@ module NeetoDeploy
27
28
  self.login_token = response["login_token"]
28
29
  end
29
30
 
31
+ def ask_for_org_subdomain
32
+ ui.say(
33
+ <<~EOF
34
+ Welcome to neetoDeploy CLI. To get started, we need your organization's subdomain.
35
+
36
+ If your organization URL is "myorg.neetodeploy.com", your organization subdomain is "myorg".
37
+ More information: https://help.neetodeploy.com/articles/neetodeploy-cli
38
+
39
+ EOF
40
+ )
41
+ self.org_subdomain = ui.ask("Please enter the subdomain of your organization:")
42
+ end
43
+
30
44
  def show_login_link_and_open_in_browser
31
45
  ui.say(
32
46
  <<~EOF
33
- A webpage will be opened in a browser. If it didn't, please open this URL in browser:
34
- #{session_login_url}
47
+ The login page will be opened in your browser. If it didn't, please open this URL in your browser:
48
+ #{session_login_url(org_subdomain)}
35
49
  EOF
36
50
  )
37
- Launchy.open(session_login_url)
51
+ Launchy.open(session_login_url(org_subdomain))
38
52
  end
39
53
 
40
54
  def wait_until_user_authenticates!
@@ -11,8 +11,9 @@ module NeetoDeploy
11
11
  NEETO_DEPLOY_CLI_API_SESSIONS_URL
12
12
  end
13
13
 
14
- def session_login_url
15
- "#{NEETO_DEPLOY_CLI_API_BASE_URL}/sessions/#{login_token}/authenticate"
14
+ def session_login_url(org_subdomain)
15
+ org_url = NEETO_DEPLOY_HOST.sub("app.", "#{org_subdomain}.")
16
+ "#{org_url}/cli/login?token=#{login_token}"
16
17
  end
17
18
 
18
19
  def session_login_status_url
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NeetoDeploy
4
- VERSION = "1.0.6"
4
+ VERSION = "1.0.7"
5
5
  CLI_API_VERSION = "v1"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neetodeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin Siby
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-15 00:00:00.000000000 Z
11
+ date: 2023-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv