neetodeploy 1.1.25 → 1.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0396bbc473e87998286bdc95905c601721c24787da18a64e7ab67a9cd42ddfa
4
- data.tar.gz: 8d002597268fcca2205aa42a5fcdeb371f2a9edcbdfeb14ff80bff449407b7e0
3
+ metadata.gz: 9d867b65e0d1fb328960f3d9c0bb78ab71373c360a6bd76159d83245fb5f21d8
4
+ data.tar.gz: 72109ffde32c0cd529f40346bab655445edc5b4463c0f94471782652f71a28ad
5
5
  SHA512:
6
- metadata.gz: 0f07f591022176db4bd74ab0b6a5c3839634c728f5db28cef1cd504d2ff728fcec857fe84d85a9c02ba9b01a99a56d1086d41c023a318d789b5f3b26ddcd32b0
7
- data.tar.gz: d7bc9e789cf2174cca1beb3fc37b816ceeb7d554fab45be4d50e46d24d0f4cec7d4f1d094b78f5b22847f46c59bf65c125317fa7180c307cfb202a07d8e5286b
6
+ metadata.gz: d9113ac07cf733b98b639963a092b38937b27adf96a52a7c3eb7c70b0e3af64df5550fe3fb8a0af525a77095b9ce6e3025bf7c2edd7375dc0a5598a136315ab8
7
+ data.tar.gz: dfdae9fac4d8a99a6387cdbee1f09358f055419bfbc8be6acb86c5de63f2278e60b23d3efd709b5c16fc6c0c3fe5d3b6d36b35600caf757f13e1b414240d06bb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neetodeploy (1.1.25)
4
+ neetodeploy (1.1.27)
5
5
  base64
6
6
  bigdecimal
7
7
  colorize
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "thor"
4
+ require "json"
5
+
6
+ require_relative "../session"
7
+ require_relative "./constants"
8
+
9
+ module NeetoDeploy
10
+ class CLI
11
+ module Apps
12
+ class Base < CLI::Base
13
+ include Constants
14
+ include Session
15
+
16
+ attr_reader :app_slug
17
+
18
+ def initialize(app_slug)
19
+ super()
20
+ @app_slug = app_slug
21
+ end
22
+
23
+ def process!
24
+ ui.execute_with_loading("Fetching app details...") do
25
+ @response = send_get_request(app_details_url(app_slug), {})
26
+ end
27
+
28
+ ui.error(@response["error"] || @response.message) and return unless @response.success?
29
+
30
+ parsed_response = JSON.parse(@response.body)
31
+ app_data = parsed_response["app"] || parsed_response
32
+ ui.info(JSON.pretty_generate(app_data))
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NeetoDeploy
4
+ class CLI
5
+ module Apps
6
+ module Constants
7
+ NEETO_DEPLOY_CLI_V2_API_BASE_URL = "#{NEETO_DEPLOY_HOST}/api/cli/v2".freeze
8
+ NEETO_DEPLOY_CLI_API_V2_APPS_URL = "#{NEETO_DEPLOY_CLI_V2_API_BASE_URL}/apps".freeze
9
+
10
+ def app_details_url(app_slug)
11
+ "#{NEETO_DEPLOY_CLI_API_V2_APPS_URL}/#{app_slug}"
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -28,6 +28,7 @@ module NeetoDeploy
28
28
 
29
29
  def process!
30
30
  start_spinner
31
+ print_github_repo_name
31
32
  response = fetch_logs
32
33
  @spinner.stop
33
34
 
@@ -65,6 +66,17 @@ module NeetoDeploy
65
66
  send_get_request(logs_v2_url, params)
66
67
  end
67
68
 
69
+ def print_github_repo_name
70
+ response = send_get_request(app_details_url(app_slug), {})
71
+ return unless response.success?
72
+
73
+ data = JSON.parse(response.body)
74
+ repo_name = data.dig("app", "github_repo_name").to_s
75
+ ui.info("GitHub repository: #{repo_name}") if repo_name.strip != ""
76
+ rescue StandardError
77
+ nil
78
+ end
79
+
68
80
  def poll_for_logs
69
81
  loop do
70
82
  response = fetch_logs(after_timestamp_ms: @last_timestamp_ms)
@@ -5,11 +5,16 @@ module NeetoDeploy
5
5
  module Logs
6
6
  module Constants
7
7
  NEETO_DEPLOY_CLI_V2_API_BASE_URL = "#{NEETO_DEPLOY_HOST}/api/cli/v2".freeze
8
+ NEETO_DEPLOY_CLI_API_V2_APPS_URL = "#{NEETO_DEPLOY_CLI_V2_API_BASE_URL}/apps".freeze
8
9
  NEETO_DEPLOY_CLI_API_V2_LOGS_URL = "#{NEETO_DEPLOY_CLI_V2_API_BASE_URL}/logs".freeze
9
10
 
10
11
  def logs_v2_url
11
12
  NEETO_DEPLOY_CLI_API_V2_LOGS_URL
12
13
  end
14
+
15
+ def app_details_url(app_slug)
16
+ "#{NEETO_DEPLOY_CLI_API_V2_APPS_URL}/#{app_slug}"
17
+ end
13
18
  end
14
19
  end
15
20
  end
@@ -19,7 +19,7 @@ module NeetoDeploy
19
19
  end
20
20
 
21
21
  def send_get_request(url, body)
22
- HTTParty.get(url, { body: common_body.merge(body), format: :json })
22
+ HTTParty.get(url, { query: common_body.merge(body), format: :json })
23
23
  end
24
24
 
25
25
  def send_post_request(url, body)
@@ -11,6 +11,7 @@ module NeetoDeploy
11
11
  require_relative "cli/login/base"
12
12
  require_relative "cli/exec/base"
13
13
  require_relative "cli/logs/base"
14
+ require_relative "cli/apps/base"
14
15
  require_relative "cli/env/commands"
15
16
  require_relative "cli/redis/commands"
16
17
  require_relative "cli/pg/commands"
@@ -50,6 +51,12 @@ module NeetoDeploy
50
51
  CLI::Logs::Base.new(options[:app], options[:process_type]).process!
51
52
  end
52
53
 
54
+ desc "apps", "Show app details"
55
+ option :app, type: :string, aliases: "-a", required: true, desc: "App slug"
56
+ def apps
57
+ CLI::Apps::Base.new(options[:app]).process!
58
+ end
59
+
53
60
  desc "redis", "Manage redis addons"
54
61
  subcommand "redis", Redis::Commands
55
62
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NeetoDeploy
4
- VERSION = "1.1.25"
4
+ VERSION = "1.1.27"
5
5
  CLI_API_VERSION = "v1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neetodeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.25
4
+ version: 1.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin Siby
@@ -228,6 +228,8 @@ files:
228
228
  - lib/neeto_deploy/cli/addon/constants.rb
229
229
  - lib/neeto_deploy/cli/addon/info.rb
230
230
  - lib/neeto_deploy/cli/addon/scheduled_exports_settings.rb
231
+ - lib/neeto_deploy/cli/apps/base.rb
232
+ - lib/neeto_deploy/cli/apps/constants.rb
231
233
  - lib/neeto_deploy/cli/autoscaling_config/commands.rb
232
234
  - lib/neeto_deploy/cli/autoscaling_config/constants.rb
233
235
  - lib/neeto_deploy/cli/autoscaling_config/list.rb
@@ -283,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
283
285
  - !ruby/object:Gem::Version
284
286
  version: '0'
285
287
  requirements: []
286
- rubygems_version: 3.4.19
288
+ rubygems_version: 3.5.10
287
289
  signing_key:
288
290
  specification_version: 4
289
291
  summary: CLI for neetoDeploy