serverkit 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +2 -2
- data/lib/serverkit/actions/apply.rb +12 -4
- data/lib/serverkit/actions/check.rb +9 -3
- data/lib/serverkit/resources/base.rb +7 -2
- data/lib/serverkit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c00c2ac80338e61da1d1b07403cd86449a4a1ac9
|
4
|
+
data.tar.gz: c835c29a91aa4dd642b24b7f9057cd808a208327
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d8390a050502e6348bb951c88a26e47254c3d013a67de78bca8169e23b7b2260a77c1e4f000aed05522f8d306c6a4fccb7202c6fd47abf608a965e485277cb2
|
7
|
+
data.tar.gz: c80d55fc927edf108dfdaae10d2d10bd1b57976ba3aaffe542425da940a155385816ce060e667f81159d5daa07165a79ddff64818b512ae25393eb6404181adf
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -171,8 +171,6 @@ A resource must have a type attribute. Currently the following types are availab
|
|
171
171
|
- command
|
172
172
|
- file
|
173
173
|
- git
|
174
|
-
- homebrew
|
175
|
-
- homebrew_cask
|
176
174
|
- nothing
|
177
175
|
- package
|
178
176
|
- recipe
|
@@ -224,6 +222,7 @@ Serverkit finds `Serverkit::Resources::FooBar` resource class from `type: "foo_b
|
|
224
222
|
|
225
223
|
- [serverkit-atom](https://github.com/r7kamura/serverkit-atom)
|
226
224
|
- [serverkit-defaults](https://github.com/r7kamura/serverkit-defaults)
|
225
|
+
- [serverkit-homebrew](https://github.com/r7kamura/serverkit-homebrew)
|
227
226
|
- [serverkit-karabiner](https://github.com/r7kamura/serverkit-karabiner)
|
228
227
|
- [serverkit-rbenv](https://github.com/r7kamura/serverkit-rbenv)
|
229
228
|
|
@@ -232,6 +231,7 @@ Serverkit finds `Serverkit::Resources::FooBar` resource class from `type: "foo_b
|
|
232
231
|
gem "serverkit"
|
233
232
|
gem "serverkit-atom"
|
234
233
|
gem "serverkit-defaults"
|
234
|
+
gem "serverkit-homebrew"
|
235
235
|
gem "serverkit-karabiner"
|
236
236
|
gem "serverkit-rbenv"
|
237
237
|
```
|
@@ -5,20 +5,28 @@ module Serverkit
|
|
5
5
|
module Actions
|
6
6
|
class Apply < Base
|
7
7
|
def run
|
8
|
-
backends.map do |backend|
|
8
|
+
successful = backends.map do |backend|
|
9
9
|
Thread.new do
|
10
|
-
recipe.resources.map(&:clone).map do |resource|
|
10
|
+
resources = recipe.resources.map(&:clone).map do |resource|
|
11
11
|
resource.backend = backend
|
12
12
|
resource.run_apply
|
13
13
|
puts resource.inspect_apply_result
|
14
14
|
resource
|
15
|
-
end
|
15
|
+
end
|
16
|
+
handlers = resources.select(&:notifiable?).flat_map(&:handlers).uniq.map(&:clone).map do |handler|
|
16
17
|
handler.backend = backend
|
17
18
|
handler.run_apply
|
18
19
|
puts handler.inspect_apply_result
|
20
|
+
handler
|
19
21
|
end
|
22
|
+
resources + handlers
|
20
23
|
end
|
21
|
-
end.
|
24
|
+
end.map(&:value).flatten.all?(&:successful?)
|
25
|
+
if successful
|
26
|
+
exit
|
27
|
+
else
|
28
|
+
exit(1)
|
29
|
+
end
|
22
30
|
end
|
23
31
|
end
|
24
32
|
end
|
@@ -5,15 +5,21 @@ module Serverkit
|
|
5
5
|
module Actions
|
6
6
|
class Check < Base
|
7
7
|
def run
|
8
|
-
backends.map do |backend|
|
8
|
+
successful = backends.map do |backend|
|
9
9
|
Thread.new do
|
10
|
-
recipe.resources.map(&:clone).
|
10
|
+
recipe.resources.map(&:clone).map do |resource|
|
11
11
|
resource.backend = backend
|
12
12
|
resource.run_check
|
13
13
|
puts resource.inspect_check_result
|
14
|
+
resource
|
14
15
|
end
|
15
16
|
end
|
16
|
-
end.
|
17
|
+
end.map(&:value).flatten.all?(&:successful?)
|
18
|
+
if successful
|
19
|
+
exit
|
20
|
+
else
|
21
|
+
exit(1)
|
22
|
+
end
|
17
23
|
end
|
18
24
|
end
|
19
25
|
end
|
@@ -86,14 +86,19 @@ module Serverkit
|
|
86
86
|
def run_apply
|
87
87
|
unless run_check
|
88
88
|
apply
|
89
|
-
@recheck_result = recheck
|
89
|
+
@recheck_result = !!recheck
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
93
|
# @note #check wrapper
|
94
94
|
# @return [true, false]
|
95
95
|
def run_check
|
96
|
-
@check_result = check
|
96
|
+
@check_result = !!check
|
97
|
+
end
|
98
|
+
|
99
|
+
# @return [true, false]
|
100
|
+
def successful?
|
101
|
+
@check_result == true || @recheck_result == true
|
97
102
|
end
|
98
103
|
|
99
104
|
# @note recipe resource will override to replace itself with multiple resources
|
data/lib/serverkit/version.rb
CHANGED