deplomat 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +14 -62
- data/VERSION +1 -1
- data/deplomat.gemspec +1 -1
- data/lib/deplomat/node.rb +27 -7
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e9219f57f21ff90282cc86893d24ba465a64d5af5328fa34ea178f1080f8b38
|
4
|
+
data.tar.gz: 690b25723ba53be14fcd54770fdd3b994ddf516e74908d926c3e5cc48e4d856e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c24dd2f80073a91de3cb09b2780ff11ddc42e08e96fc3ce0d7d4f851175a1b9665c6f99bfd0a2684c43843fa740961f3e2272b6ade4680091bc787a027724f66
|
7
|
+
data.tar.gz: ec174a32acce4e363e9dfc43f8efb8ca55f82feb93f36469c699630053d826f428b6e0307c38d9584a25509333fb26b9510609738c30903007c091fbb8569502
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,71 +1,24 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.4.0)
|
5
|
-
builder (3.2.3)
|
6
4
|
colorize (0.8.1)
|
7
|
-
descendants_tracker (0.0.4)
|
8
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
9
5
|
diff-lcs (1.3)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
hashie (>= 3.4)
|
19
|
-
mime-types (>= 1.16, < 3.0)
|
20
|
-
oauth2 (~> 1.0)
|
21
|
-
hashie (3.5.7)
|
22
|
-
highline (1.7.10)
|
23
|
-
jeweler (2.3.9)
|
24
|
-
builder
|
25
|
-
bundler
|
26
|
-
git (>= 1.2.5)
|
27
|
-
github_api (~> 0.16.0)
|
28
|
-
highline (>= 1.6.15)
|
29
|
-
nokogiri (>= 1.5.10)
|
30
|
-
psych
|
31
|
-
rake
|
32
|
-
rdoc
|
33
|
-
semver2
|
34
|
-
jwt (1.5.6)
|
35
|
-
mime-types (2.99.3)
|
36
|
-
mini_portile2 (2.3.0)
|
37
|
-
multi_json (1.13.1)
|
38
|
-
multi_xml (0.6.0)
|
39
|
-
multipart-post (2.0.0)
|
40
|
-
nokogiri (1.8.2)
|
41
|
-
mini_portile2 (~> 2.3.0)
|
42
|
-
oauth2 (1.4.0)
|
43
|
-
faraday (>= 0.8, < 0.13)
|
44
|
-
jwt (~> 1.0)
|
45
|
-
multi_json (~> 1.3)
|
46
|
-
multi_xml (~> 0.5)
|
47
|
-
rack (>= 1.2, < 3)
|
48
|
-
psych (3.0.2)
|
49
|
-
rack (2.0.6)
|
50
|
-
rake (12.3.1)
|
51
|
-
rdoc (6.0.4)
|
52
|
-
rspec (3.7.0)
|
53
|
-
rspec-core (~> 3.7.0)
|
54
|
-
rspec-expectations (~> 3.7.0)
|
55
|
-
rspec-mocks (~> 3.7.0)
|
56
|
-
rspec-core (3.7.1)
|
57
|
-
rspec-support (~> 3.7.0)
|
58
|
-
rspec-expectations (3.7.0)
|
6
|
+
ffi (1.11.1)
|
7
|
+
rspec (3.8.0)
|
8
|
+
rspec-core (~> 3.8.0)
|
9
|
+
rspec-expectations (~> 3.8.0)
|
10
|
+
rspec-mocks (~> 3.8.0)
|
11
|
+
rspec-core (3.8.2)
|
12
|
+
rspec-support (~> 3.8.0)
|
13
|
+
rspec-expectations (3.8.4)
|
59
14
|
diff-lcs (>= 1.2.0, < 2.0)
|
60
|
-
rspec-support (~> 3.
|
61
|
-
rspec-mocks (3.
|
15
|
+
rspec-support (~> 3.8.0)
|
16
|
+
rspec-mocks (3.8.1)
|
62
17
|
diff-lcs (>= 1.2.0, < 2.0)
|
63
|
-
rspec-support (~> 3.
|
64
|
-
rspec-support (3.
|
65
|
-
|
66
|
-
sys-proctable (1.2.0)
|
18
|
+
rspec-support (~> 3.8.0)
|
19
|
+
rspec-support (3.8.2)
|
20
|
+
sys-proctable (1.2.1)
|
67
21
|
ffi
|
68
|
-
thread_safe (0.3.6)
|
69
22
|
|
70
23
|
PLATFORMS
|
71
24
|
ruby
|
@@ -73,9 +26,8 @@ PLATFORMS
|
|
73
26
|
DEPENDENCIES
|
74
27
|
bundler (~> 1.0)
|
75
28
|
colorize
|
76
|
-
jeweler
|
77
29
|
rspec
|
78
30
|
sys-proctable
|
79
31
|
|
80
32
|
BUNDLED WITH
|
81
|
-
1.
|
33
|
+
1.17.2
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.11
|
data/deplomat.gemspec
CHANGED
data/lib/deplomat/node.rb
CHANGED
@@ -2,8 +2,17 @@ module Deplomat
|
|
2
2
|
|
3
3
|
class Node
|
4
4
|
|
5
|
-
attr_accessor :log_to, :raise_exceptions, :logfile
|
5
|
+
attr_accessor :log_to, :raise_exceptions, :logfile, :wrap_in
|
6
6
|
attr_reader :current_path
|
7
|
+
attr_writer :stdout_lines_to_ignore
|
8
|
+
|
9
|
+
def stdout_lines_to_ignore
|
10
|
+
if @stdout_lines_to_ignore.kind_of?(Array)
|
11
|
+
@stdout_lines_to_ignore
|
12
|
+
else
|
13
|
+
[@stdout_lines_to_ignore]
|
14
|
+
end.compact
|
15
|
+
end
|
7
16
|
|
8
17
|
def initialize(logfile: "#{Dir.pwd}/deplomat.log", log_to: [:stdout], path: nil, raise_exceptions: true)
|
9
18
|
@log_to = log_to
|
@@ -14,13 +23,18 @@ module Deplomat
|
|
14
23
|
|
15
24
|
def execute(command, path=@current_path, message: [], stdout_source: :stdout, log_command: true, _raise_exceptions: @raise_exceptions)
|
16
25
|
|
26
|
+
original_command = command
|
27
|
+
if @wrap_in
|
28
|
+
command = @wrap_in.sub("_command_", command)
|
29
|
+
end
|
30
|
+
|
17
31
|
message = [message] if message.kind_of?(String)
|
18
32
|
log(message[0] + "\n", color: 'white') unless message.empty? || message.nil?
|
19
33
|
|
20
34
|
# Respect current_path
|
21
|
-
command_to_log =
|
35
|
+
command_to_log = original_command
|
22
36
|
if path
|
23
|
-
command_to_log = "#{
|
37
|
+
command_to_log = "#{original_command}\n(in #{path})"
|
24
38
|
command = "cd #{path} && #{command}"
|
25
39
|
end
|
26
40
|
|
@@ -30,12 +44,18 @@ module Deplomat
|
|
30
44
|
|
31
45
|
# Sometimes, programs write in stderr, although there are no errors.
|
32
46
|
# rake assets:precompile does that, for example.
|
33
|
-
stdout_source_object = (stdout_source == :stderr ? stderr : stdout)
|
47
|
+
stdout_source_object = (stdout_source == :stderr ? stderr : stdout)
|
34
48
|
|
35
49
|
log("--> " + command_to_log + "\n", color: "white") if log_command
|
36
|
-
|
37
|
-
|
38
|
-
|
50
|
+
stdout_source_object.readlines.each_with_index do |line, i|
|
51
|
+
self.stdout_lines_to_ignore.each do |line_to_ignore|
|
52
|
+
line_to_ignore = line_to_ignore.to_a if line_to_ignore.kind_of?(Range)
|
53
|
+
line_to_ignore = [line_to_ignore] if line_to_ignore.kind_of?(Integer)
|
54
|
+
unless line_to_ignore.include?(i+1)
|
55
|
+
out << line
|
56
|
+
log(" #{line}") if log_command
|
57
|
+
end
|
58
|
+
end
|
39
59
|
end
|
40
60
|
|
41
61
|
error_out = ""
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deplomat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Snitko
|
@@ -138,8 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
|
-
|
142
|
-
rubygems_version: 2.7.6
|
141
|
+
rubygems_version: 3.0.3
|
143
142
|
signing_key:
|
144
143
|
specification_version: 4
|
145
144
|
summary: Stack agnostic deployment system that uses bash and ssh commands
|