neetodeploy 1.0.7 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/exe/neetodeploy +3 -10
- data/lib/neeto_deploy/cli/exec/base.rb +24 -1
- data/lib/neeto_deploy/cli/exec/constants.rb +15 -0
- data/lib/neeto_deploy/version.rb +1 -1
- 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: 276d258156c0ee7ad4bc734309338fcc556ae8436091d0a11d0b6ff6e3df1e62
|
4
|
+
data.tar.gz: ea6e841532dba9be78480550fca53f4f3130c4da5b50e2cacc808e55d00e9817
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c910a456114f52e635d6ebd825f36d248d64a15f2e0237da297654a0e40d66c8b4074b3f984dc3b8b1b21ca412e69876c0e6d1bb65470fcbf15cc57196583a3c
|
7
|
+
data.tar.gz: b653ba2d0c4f2737bf94834ff9ffadf03700474c1e63bbdebc2f4e1780df67891e65692bc2c4deafcbbe88dac15dc1b4b3af7ea4b6c16e4a717470b8c70a8c2e
|
data/Gemfile.lock
CHANGED
data/exe/neetodeploy
CHANGED
@@ -2,28 +2,21 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "dotenv"
|
5
|
-
require "bundler/setup"
|
6
5
|
|
7
6
|
MIN_RUBY_VERSION = File.read(File.expand_path("../.ruby-version", __dir__)).strip
|
8
7
|
|
9
8
|
raise "neetodeploy requires Ruby version of #{MIN_RUBY_VERSION} or higher" if RUBY_VERSION < MIN_RUBY_VERSION
|
10
9
|
|
11
|
-
Dotenv.load(
|
12
|
-
File.expand_path("../.env.development", __dir__)
|
13
|
-
)
|
10
|
+
Dotenv.load(File.expand_path("../.env.development", __dir__))
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
if File.exist?(base_path)
|
12
|
+
if ENV["DEV_ENVIRONMENT"]
|
18
13
|
require_relative "../lib/neeto_deploy"
|
19
14
|
else
|
20
15
|
require "neeto_deploy"
|
21
16
|
end
|
22
17
|
|
23
|
-
args = ARGV
|
24
|
-
|
25
18
|
begin
|
26
|
-
NeetoDeploy::CLI.start(
|
19
|
+
NeetoDeploy::CLI.start(ARGV, debug: true)
|
27
20
|
rescue Exception => e
|
28
21
|
NeetoDeploy::ExceptionHandler.new(e).process
|
29
22
|
end
|
@@ -3,19 +3,38 @@ require "websocket-client-simple"
|
|
3
3
|
require "thor"
|
4
4
|
require "readline"
|
5
5
|
|
6
|
+
require_relative "../session"
|
7
|
+
require_relative "./constants"
|
8
|
+
|
6
9
|
module NeetoDeploy
|
7
10
|
class CLI
|
8
11
|
module Exec
|
9
12
|
class Base < CLI::Base
|
13
|
+
include Constants
|
14
|
+
include Session
|
15
|
+
|
10
16
|
attr_reader :app_name
|
17
|
+
|
11
18
|
def initialize(app_name)
|
19
|
+
super()
|
12
20
|
@app_name = app_name
|
13
21
|
end
|
14
22
|
|
15
23
|
def process!
|
16
24
|
puts "Opening console for #{app_name}"
|
17
25
|
|
18
|
-
|
26
|
+
response = send_post_request(
|
27
|
+
console_session_create_url, {
|
28
|
+
# TODO refactor app_slug to app_name in dashboard app
|
29
|
+
app_slug: app_name,
|
30
|
+
}
|
31
|
+
)
|
32
|
+
|
33
|
+
ui.error(response) and return unless response.success?
|
34
|
+
|
35
|
+
console_token = response.parsed_response["console_token"]
|
36
|
+
|
37
|
+
ws = WebSocket::Client::Simple.connect "wss://neeto-deploy-lc.neetoreviewapp.net/cli_console?deployment_name=#{app_name}&console_token=#{console_token}"
|
19
38
|
|
20
39
|
prompt = ''
|
21
40
|
|
@@ -46,6 +65,10 @@ module NeetoDeploy
|
|
46
65
|
exit 1
|
47
66
|
end
|
48
67
|
|
68
|
+
trap("SIGINT") do
|
69
|
+
Thread.new { ws.send "4" }
|
70
|
+
end
|
71
|
+
|
49
72
|
loop do
|
50
73
|
sleep 0.1
|
51
74
|
input = Readline.readline(prompt, true)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NeetoDeploy
|
4
|
+
class CLI
|
5
|
+
module Exec
|
6
|
+
module Constants
|
7
|
+
NEETO_DEPLOY_CLI_API_CONSOLE_SESSION_CREATE_URL = "#{NEETO_DEPLOY_CLI_API_BASE_URL}/console_sessions".freeze
|
8
|
+
|
9
|
+
def console_session_create_url
|
10
|
+
NEETO_DEPLOY_CLI_API_CONSOLE_SESSION_CREATE_URL
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/neeto_deploy/version.rb
CHANGED
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.
|
4
|
+
version: 1.0.9
|
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-
|
11
|
+
date: 2023-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- lib/neeto_deploy/cli/config/set.rb
|
116
116
|
- lib/neeto_deploy/cli/config/unset.rb
|
117
117
|
- lib/neeto_deploy/cli/exec/base.rb
|
118
|
+
- lib/neeto_deploy/cli/exec/constants.rb
|
118
119
|
- lib/neeto_deploy/cli/login/base.rb
|
119
120
|
- lib/neeto_deploy/cli/login/constants.rb
|
120
121
|
- lib/neeto_deploy/cli/logs/base.rb
|