ops_team 0.18.0 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/executor.rb +0 -9
- data/lib/hook_handler.rb +8 -1
- data/lib/ops.rb +2 -1
- data/ops_team.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d591b58dad032824721105b4ce3e45c63ef40078273d77fbb85ddf50c3224f27
|
4
|
+
data.tar.gz: f3f72de653d0ad2d3b87ef1ac6c75bfe0543b6030b37954fae1ddf4dd2981e17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42df63cce2068a86cbe127da74fdf4af2dfb33f3bb4d7ed176354566b11adc1ba3adbbc941b0df8440bcdc1cfaf76f4e9e7182c41618cee1ca9695d8fa1bdca7
|
7
|
+
data.tar.gz: 451205a2bde8e20689f2b5b1b76d60f3cf3d2db5d74d18c2f71cc21219863bc4a87373c5980833e90d647314eb937b4dc02f13ad940636603d7dd37faf4764e4
|
data/lib/executor.rb
CHANGED
@@ -3,15 +3,6 @@
|
|
3
3
|
class Executor
|
4
4
|
attr_reader :output, :exit_code
|
5
5
|
|
6
|
-
class << self
|
7
|
-
def execute(command)
|
8
|
-
@output, status = Open3.capture2e(command)
|
9
|
-
@exit_code = status.exitstatus
|
10
|
-
|
11
|
-
[@output, @exit_code]
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
6
|
def initialize(command)
|
16
7
|
@command = command
|
17
8
|
end
|
data/lib/hook_handler.rb
CHANGED
@@ -25,11 +25,18 @@ class HookHandler
|
|
25
25
|
def execute_hooks(name)
|
26
26
|
hooks(name).each do |hook|
|
27
27
|
Output.notice("Running #{name} hook: #{hook}")
|
28
|
-
output, exit_code =
|
28
|
+
output, exit_code = execute_hook(hook)
|
29
29
|
|
30
30
|
next if exit_code.zero?
|
31
31
|
|
32
32
|
raise HookExecError, "#{name} hook '#{hook}' failed with exit code #{exit_code}:\n#{output}"
|
33
33
|
end
|
34
34
|
end
|
35
|
+
|
36
|
+
def execute_hook(name)
|
37
|
+
executor = Executor.new(name)
|
38
|
+
executor.execute
|
39
|
+
|
40
|
+
[executor.output, executor.exit_code]
|
41
|
+
end
|
35
42
|
end
|
data/lib/ops.rb
CHANGED
@@ -127,10 +127,11 @@ class Ops
|
|
127
127
|
end
|
128
128
|
|
129
129
|
def do_before_action
|
130
|
-
|
130
|
+
return if ENV["OPS_RUNNING"] || action.skip_hooks?("before")
|
131
131
|
|
132
132
|
# this prevents before hooks from running in ops executed by ops
|
133
133
|
ENV["OPS_RUNNING"] = "1"
|
134
|
+
hook_handler.do_hooks("before")
|
134
135
|
end
|
135
136
|
|
136
137
|
def hook_handler
|
data/ops_team.gemspec
CHANGED