neetodeploy 1.1.9 → 1.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +11 -6
- data/lib/neeto_deploy/cli/exec/base.rb +0 -1
- data/lib/neeto_deploy/cli/logs/base.rb +34 -46
- data/lib/neeto_deploy/version.rb +1 -1
- data/neetodeploy.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a3d1d307a336febc75e845090520f3b9682fccb51d37f1d916b7e687f60552f
|
4
|
+
data.tar.gz: 29f7510011934930720d507581cfffa69ea51eeca7c338da3cab3bd496b7a981
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1afa2622a80ca5398335fbc166e2ad018be68e679d2d62ab837dca25e2a33a5358de3f1ce3a185d0641b6edf814acc13238a8258f193d3de1e78d73163ba9e2
|
7
|
+
data.tar.gz: 2f5c3ada11bf0ade6600c2e3af217e4b2203ea53e13d7cca543872042e95b334b8698d1b328971c24988cdc57c3b239702db9e6a33faae9e6478be0f4fb659a7
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
neetodeploy (1.1.
|
4
|
+
neetodeploy (1.1.10)
|
5
5
|
colorize
|
6
6
|
dotenv (~> 2.8.1)
|
7
7
|
httparty (~> 0.21.0)
|
@@ -9,7 +9,7 @@ PATH
|
|
9
9
|
terminal-table (~> 3.0.2)
|
10
10
|
thor (~> 1.3.0)
|
11
11
|
tty-spinner
|
12
|
-
websocket-client
|
12
|
+
websocket-eventmachine-client
|
13
13
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
byebug (11.1.3)
|
20
20
|
colorize (1.1.0)
|
21
21
|
dotenv (2.8.1)
|
22
|
-
|
22
|
+
eventmachine (1.2.7)
|
23
23
|
httparty (0.21.0)
|
24
24
|
mini_mime (>= 1.0.0)
|
25
25
|
multi_xml (>= 0.5.2)
|
@@ -36,9 +36,13 @@ GEM
|
|
36
36
|
tty-cursor (~> 0.7)
|
37
37
|
unicode-display_width (2.4.2)
|
38
38
|
websocket (1.2.9)
|
39
|
-
websocket-
|
40
|
-
|
41
|
-
websocket
|
39
|
+
websocket-eventmachine-base (1.2.0)
|
40
|
+
eventmachine (~> 1.0)
|
41
|
+
websocket (~> 1.0)
|
42
|
+
websocket-native (~> 1.0)
|
43
|
+
websocket-eventmachine-client (1.3.0)
|
44
|
+
websocket-eventmachine-base (~> 1.0)
|
45
|
+
websocket-native (1.0.0)
|
42
46
|
|
43
47
|
PLATFORMS
|
44
48
|
arm64-darwin-20
|
@@ -48,6 +52,7 @@ PLATFORMS
|
|
48
52
|
DEPENDENCIES
|
49
53
|
byebug
|
50
54
|
neetodeploy!
|
55
|
+
websocket-eventmachine-client
|
51
56
|
|
52
57
|
BUNDLED WITH
|
53
58
|
2.4.8
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "websocket-client-simple"
|
4
3
|
require "thor"
|
5
4
|
require "colorize"
|
5
|
+
require "websocket-eventmachine-client"
|
6
6
|
|
7
7
|
require_relative "../session"
|
8
8
|
require_relative "./constants"
|
@@ -14,11 +14,11 @@ module NeetoDeploy
|
|
14
14
|
include Constants
|
15
15
|
include Session
|
16
16
|
|
17
|
-
attr_reader :
|
17
|
+
attr_reader :app_slug, :process_type
|
18
18
|
|
19
|
-
def initialize(
|
19
|
+
def initialize(app_slug, process_type = nil)
|
20
20
|
super()
|
21
|
-
@
|
21
|
+
@app_slug = app_slug
|
22
22
|
@process_type = process_type
|
23
23
|
end
|
24
24
|
|
@@ -32,57 +32,45 @@ module NeetoDeploy
|
|
32
32
|
"wss://connect.neetodeploy.com/cable"
|
33
33
|
end
|
34
34
|
|
35
|
-
def ensure_app_access?
|
36
|
-
response = send_get_request(app_verify_access_url, { app_slug: app_name })
|
37
|
-
@ui.error(JSON[response.body]["error"]) unless response.success?
|
38
|
-
response.success?
|
39
|
-
end
|
40
|
-
|
41
35
|
def stream_logs
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
pubsub_token = SecureRandom.hex(16)
|
36
|
+
EM.run do
|
37
|
+
session_token = common_body[:session_token]
|
38
|
+
pubsub_token = SecureRandom.hex(16)
|
39
|
+
ws_connection = WebSocket::EventMachine::Client.connect(uri:)
|
47
40
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
41
|
+
ws_connection.onopen do
|
42
|
+
payload = {
|
43
|
+
command: "subscribe",
|
44
|
+
identifier: {
|
45
|
+
channel: "Cli::LogChannel", app_slug:, pubsub_token:, process_type:,
|
46
|
+
session_token:
|
47
|
+
}.to_json
|
48
|
+
}
|
49
|
+
ws_connection.send(payload.to_json)
|
50
|
+
end
|
58
51
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
52
|
+
ws_connection.onmessage do |msg, type|
|
53
|
+
parsed_message = JSON[msg]
|
54
|
+
if parsed_message["message"] && parsed_message["type"] != "ping"
|
55
|
+
logs = JSON[parsed_message["message"]]["streams"].flat_map do |stream|
|
56
|
+
stream["values"].map do |array|
|
57
|
+
"#{Time.at(array[0].to_i / 1e9).to_s.light_magenta} #{array[1]}"
|
58
|
+
end
|
65
59
|
end
|
66
|
-
|
67
|
-
|
60
|
+
STDOUT.puts logs
|
61
|
+
end
|
62
|
+
|
63
|
+
if parsed_message["type"] == "disconnect"
|
64
|
+
puts parsed_message["error"].red
|
65
|
+
ws_connection.close
|
68
66
|
exit
|
69
67
|
end
|
70
68
|
end
|
71
|
-
end
|
72
|
-
|
73
|
-
ws_connection.on :close do |e|
|
74
|
-
p e unless e.nil?
|
75
|
-
exit 1
|
76
|
-
end
|
77
69
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
$@.each { |backtrace| puts backtrace }
|
82
|
-
exit 1
|
70
|
+
ws_connection.onerror do |error|
|
71
|
+
puts "Error: #{error}"
|
72
|
+
end
|
83
73
|
end
|
84
|
-
|
85
|
-
loop do end
|
86
74
|
end
|
87
75
|
end
|
88
76
|
end
|
data/lib/neeto_deploy/version.rb
CHANGED
data/neetodeploy.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_dependency "launchy", "~> 2.5.0" # for opening in browser
|
36
36
|
spec.add_dependency "terminal-table", "~> 3.0.2" # for building cli table
|
37
37
|
spec.add_dependency "thor", "~> 1.3.0" # for cli
|
38
|
-
spec.add_dependency "websocket-client
|
38
|
+
spec.add_dependency "websocket-eventmachine-client"
|
39
39
|
spec.add_dependency "colorize"
|
40
40
|
spec.add_dependency "tty-spinner"
|
41
41
|
|
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.1.
|
4
|
+
version: 1.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Subin Siby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.3.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: websocket-client
|
84
|
+
name: websocket-eventmachine-client
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|