serverkit 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 612a45453d00dd4da8b327be21c8513dfb920292
4
- data.tar.gz: 4beb20763b868203c302697f114b508c5f5f4cd8
3
+ metadata.gz: 90b1a7f09683dac690655e350246e3fbc41990ec
4
+ data.tar.gz: 9e2d91038579c643adb83b4f7b54d4a3ceb710d1
5
5
  SHA512:
6
- metadata.gz: 4172b07769a11c4002e67caff3cb009262912e188b583893e4a9bf00a3a9432934088ae1c2c4df5bcf433a9e8621eaa1e33c122aab7547d03f118b39d0511ae6
7
- data.tar.gz: 5068bbb81ac75922f293ff2061a41a22de161acfadf5fb64efd3100906e37014202fedec6604ecd748d1a5b716e3834e303e113be12b27c78ccee969d5610093
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 check` and `serverkit apply` actions
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, check, and apply the recipe.
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 check
60
+ ### serverkit diff
61
61
  Shows the difference between your recipe and the state of the target host.
62
62
 
63
63
  ```
64
- $ serverkit check recipe.yml
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.check
12
+ if resource.diff
13
13
  puts "[SKIP] #{resource.id} on #{host_for(backend)}"
14
14
  else
15
15
  resource.apply
16
- result = resource.check ? "DONE" : "FAIL"
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 Check < Base
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.check ? "OK" : "NG"
12
+ result = resource.diff ? "OK" : "NG"
13
13
  puts "[ #{result} ] #{resource.id} on #{host_for(backend)}"
14
14
  end
15
15
  end
@@ -1,5 +1,5 @@
1
1
  require "serverkit/actions/apply"
2
- require "serverkit/actions/check"
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 "check"
23
- check
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 check
47
- Actions::Check.new(@argv).call
46
+ def diff
47
+ Actions::Diff.new(@argv).call
48
48
  end
49
49
 
50
50
  # @note #inspect is reserved ;(
@@ -16,7 +16,7 @@ module Serverkit
16
16
  end
17
17
 
18
18
  # @return [true, false]
19
- def check
19
+ def diff
20
20
  has_file? && has_same_content? && has_valid_group? && has_valid_owner?
21
21
  end
22
22
 
@@ -15,7 +15,7 @@ module Serverkit
15
15
  end
16
16
 
17
17
  # @return [true, false]
18
- def check
18
+ def diff
19
19
  has_git? && cloned? && !updatable?
20
20
  end
21
21
 
@@ -10,7 +10,7 @@ module Serverkit
10
10
  end
11
11
 
12
12
  # @return [true, false]
13
- def check
13
+ def diff
14
14
  check_command("/usr/local/bin/brew cask list -1 | grep -E '^#{name}$'")
15
15
  end
16
16
  end
@@ -10,7 +10,7 @@ module Serverkit
10
10
  end
11
11
 
12
12
  # @return [true, false]
13
- def check
13
+ def diff
14
14
  check_command_from_identifier(:check_package_is_installed, name)
15
15
  end
16
16
  end
@@ -9,7 +9,7 @@ module Serverkit
9
9
  run_command_from_identifier(:start, name)
10
10
  end
11
11
 
12
- def check
12
+ def diff
13
13
  check_command_from_identifier(:check_service_is_running, name)
14
14
  end
15
15
  end
@@ -11,7 +11,7 @@ module Serverkit
11
11
  end
12
12
 
13
13
  # @return [true, false]
14
- def check
14
+ def diff
15
15
  check_command_from_identifier(:check_file_is_linked_to, source, destination)
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module Serverkit
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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/check.rb
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