serverkit 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/README.md +3 -3
- data/lib/serverkit/actions/apply.rb +2 -2
- data/lib/serverkit/actions/{check.rb → diff.rb} +2 -2
- data/lib/serverkit/command.rb +6 -6
- data/lib/serverkit/resources/file.rb +1 -1
- data/lib/serverkit/resources/git.rb +1 -1
- data/lib/serverkit/resources/homebrew_cask.rb +1 -1
- data/lib/serverkit/resources/package.rb +1 -1
- data/lib/serverkit/resources/service.rb +1 -1
- data/lib/serverkit/resources/symlink.rb +1 -1
- data/lib/serverkit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90b1a7f09683dac690655e350246e3fbc41990ec
|
4
|
+
data.tar.gz: 9e2d91038579c643adb83b4f7b54d4a3ceb710d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 048688e2239eb404e45f5b9a20223fd6070de9498c43b857b13b077d16159e822c618789b33c9e2e1243f6c48c0521e91fdddad7e96b7158869cc48b46750ddc
|
7
|
+
data.tar.gz: 899ff30583a83955b4e85b5b805e9db01e0f430f1ed6700e28443115e76bd82ab7c475c9b37910985b67a8ce7de205952aef01abee5ebc3ae55a4829976c40d9
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 0.2.1
|
2
|
+
- Change action name: `serverkit check` -> `serverkit diff`
|
3
|
+
|
1
4
|
## 0.2.0
|
2
5
|
- Support multiple hosts
|
3
6
|
- Change `--host=` option to `--hosts=`
|
@@ -33,4 +36,4 @@
|
|
33
36
|
|
34
37
|
## 0.0.1
|
35
38
|
- 1st Release on 2015-03-30
|
36
|
-
- Support `serverkit
|
39
|
+
- Support `serverkit diff` and `serverkit apply` actions
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Configuration management toolkit for IT automation.
|
3
3
|
|
4
4
|
## Usage
|
5
|
-
Write a recipe, then run `serverkit` executable to validate, inspect,
|
5
|
+
Write a recipe, then run `serverkit` executable to validate, inspect, diff, and apply the recipe.
|
6
6
|
|
7
7
|
### serverkit validate
|
8
8
|
Validates recipe schema, resources, and attributes.
|
@@ -57,11 +57,11 @@ $ serverkit inspect recipe.yml
|
|
57
57
|
}
|
58
58
|
```
|
59
59
|
|
60
|
-
### serverkit
|
60
|
+
### serverkit diff
|
61
61
|
Shows the difference between your recipe and the state of the target host.
|
62
62
|
|
63
63
|
```
|
64
|
-
$ serverkit
|
64
|
+
$ serverkit diff recipe.yml
|
65
65
|
[ OK ] install_mysql
|
66
66
|
[ OK ] install_redis
|
67
67
|
[ OK ] install_licecap
|
@@ -9,11 +9,11 @@ module Serverkit
|
|
9
9
|
Thread.new do
|
10
10
|
recipe.resources.map(&:dup).each do |resource|
|
11
11
|
resource.backend = backend
|
12
|
-
if resource.
|
12
|
+
if resource.diff
|
13
13
|
puts "[SKIP] #{resource.id} on #{host_for(backend)}"
|
14
14
|
else
|
15
15
|
resource.apply
|
16
|
-
result = resource.
|
16
|
+
result = resource.diff ? "DONE" : "FAIL"
|
17
17
|
puts "[#{result}] #{resource.id} on #{host_for(backend)}"
|
18
18
|
end
|
19
19
|
end
|
@@ -3,13 +3,13 @@ require "thread"
|
|
3
3
|
|
4
4
|
module Serverkit
|
5
5
|
module Actions
|
6
|
-
class
|
6
|
+
class Diff < Base
|
7
7
|
def run
|
8
8
|
backends.map do |backend|
|
9
9
|
Thread.new do
|
10
10
|
recipe.resources.map(&:dup).each do |resource|
|
11
11
|
resource.backend = backend
|
12
|
-
result = resource.
|
12
|
+
result = resource.diff ? "OK" : "NG"
|
13
13
|
puts "[ #{result} ] #{resource.id} on #{host_for(backend)}"
|
14
14
|
end
|
15
15
|
end
|
data/lib/serverkit/command.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require "serverkit/actions/apply"
|
2
|
-
require "serverkit/actions/
|
2
|
+
require "serverkit/actions/diff"
|
3
3
|
require "serverkit/actions/inspect"
|
4
4
|
require "serverkit/actions/validate"
|
5
5
|
require "serverkit/errors/missing_action_name_argument_error"
|
@@ -19,14 +19,14 @@ module Serverkit
|
|
19
19
|
raise Errors::MissingActionNameArgumentError
|
20
20
|
when "apply"
|
21
21
|
apply
|
22
|
-
when "
|
23
|
-
|
22
|
+
when "diff"
|
23
|
+
diff
|
24
24
|
when "inspect"
|
25
25
|
_inspect
|
26
26
|
when "validate"
|
27
27
|
validate
|
28
28
|
else
|
29
|
-
raise Errors::UnknownActionNameError
|
29
|
+
raise Errors::UnknownActionNameError, action_name
|
30
30
|
end
|
31
31
|
rescue Errors::Base, Slop::MissingArgumentError, Slop::MissingOptionError => exception
|
32
32
|
abort "Error: #{exception}"
|
@@ -43,8 +43,8 @@ module Serverkit
|
|
43
43
|
Actions::Apply.new(@argv).call
|
44
44
|
end
|
45
45
|
|
46
|
-
def
|
47
|
-
Actions::
|
46
|
+
def diff
|
47
|
+
Actions::Diff.new(@argv).call
|
48
48
|
end
|
49
49
|
|
50
50
|
# @note #inspect is reserved ;(
|
data/lib/serverkit/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
@@ -194,7 +194,7 @@ files:
|
|
194
194
|
- lib/serverkit.rb
|
195
195
|
- lib/serverkit/actions/apply.rb
|
196
196
|
- lib/serverkit/actions/base.rb
|
197
|
-
- lib/serverkit/actions/
|
197
|
+
- lib/serverkit/actions/diff.rb
|
198
198
|
- lib/serverkit/actions/inspect.rb
|
199
199
|
- lib/serverkit/actions/validate.rb
|
200
200
|
- lib/serverkit/command.rb
|