serverkit 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -0
- data/lib/serverkit/resources/base.rb +15 -1
- data/lib/serverkit/resources/command.rb +0 -4
- data/lib/serverkit/resources/file.rb +0 -5
- data/lib/serverkit/resources/git.rb +3 -8
- data/lib/serverkit/resources/homebrew_cask.rb +0 -7
- data/lib/serverkit/resources/package.rb +0 -7
- data/lib/serverkit/resources/service.rb +0 -7
- data/lib/serverkit/resources/symlink.rb +2 -8
- data/lib/serverkit/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f40c38c419fd96b3e97a018266dccf0e33b61840
|
4
|
+
data.tar.gz: 88d12492f9067a4b315659ede04688121467a050
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f05703924e9cb0f31d9930b90562805c8eabff0f8bf84485aaf910d602985bac4bf3bd46173f4d2e585fa8998c8e1285659da7dcc17ac078b4a831277bd08ab1
|
7
|
+
data.tar.gz: 9094021c5a28689cc70cafcbaac895486a2fd44a4fbc447a6d61d29a55b66dfe5c6ec9506f8cc14161adf16046de0329cacc3bfb4e8ca4a5b85839aaf38497da
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -24,6 +24,7 @@ Write a recipe, then run `serverkit` executable to validate, inspect, check, and
|
|
24
24
|
### serverkit validate
|
25
25
|
Validates recipe schema, resources, and attributes.
|
26
26
|
For instance, it shows validation error if `source` attributes is missing in `file` resource.
|
27
|
+
If any validation error is detected, it returns exit status 1.
|
27
28
|
|
28
29
|
```
|
29
30
|
$ serverkit validate recipe.yml
|
@@ -70,6 +71,7 @@ $ serverkit inspect recipe.yml
|
|
70
71
|
|
71
72
|
### serverkit check
|
72
73
|
Shows the difference between your recipe and the state of the target host.
|
74
|
+
If any difference is detected, it returns exit status 1.
|
73
75
|
|
74
76
|
```
|
75
77
|
$ serverkit check recipe.yml
|
@@ -83,6 +85,7 @@ $ serverkit check recipe.yml
|
|
83
85
|
|
84
86
|
### serverkit apply
|
85
87
|
Executes migration process to fill-in the gaps.
|
88
|
+
If any failure is detected, it returns exit status 1.
|
86
89
|
|
87
90
|
```
|
88
91
|
$ serverkit apply recipe.yml
|
@@ -135,7 +135,7 @@ module Serverkit
|
|
135
135
|
# @note For override
|
136
136
|
# @return [String]
|
137
137
|
def default_id
|
138
|
-
|
138
|
+
required_values.join(" ")
|
139
139
|
end
|
140
140
|
|
141
141
|
# @note For override
|
@@ -158,6 +158,20 @@ module Serverkit
|
|
158
158
|
def run_command_from_identifier(*args)
|
159
159
|
run_command(backend.command.get(*args))
|
160
160
|
end
|
161
|
+
|
162
|
+
# @return [Array<Symbol>]
|
163
|
+
def required_attribute_names
|
164
|
+
_validators.select do |key, validators|
|
165
|
+
validators.grep(::RequiredValidator).any?
|
166
|
+
end.keys
|
167
|
+
end
|
168
|
+
|
169
|
+
# @return [Array]
|
170
|
+
def required_values
|
171
|
+
required_attribute_names.map do |required_attribute_name|
|
172
|
+
send(required_attribute_name)
|
173
|
+
end
|
174
|
+
end
|
161
175
|
end
|
162
176
|
end
|
163
177
|
end
|
@@ -3,11 +3,11 @@ require "serverkit/resources/base"
|
|
3
3
|
module Serverkit
|
4
4
|
module Resources
|
5
5
|
class Git < Base
|
6
|
-
|
6
|
+
DEFAULT_STATE = "cloned"
|
7
7
|
|
8
8
|
attribute :path, required: true, type: String
|
9
9
|
attribute :repository, required: true, type: String
|
10
|
-
attribute :
|
10
|
+
attribute :state, default: DEFAULT_STATE, type: String
|
11
11
|
|
12
12
|
# @note Override
|
13
13
|
def apply
|
@@ -35,11 +35,6 @@ module Serverkit
|
|
35
35
|
check_command_from_identifier(:check_file_is_directory, git_path)
|
36
36
|
end
|
37
37
|
|
38
|
-
# @note Override
|
39
|
-
def default_id
|
40
|
-
repository
|
41
|
-
end
|
42
|
-
|
43
38
|
# @return [String] Path to .git directory in the cloned repository
|
44
39
|
def git_path
|
45
40
|
::File.join(path, ".git")
|
@@ -60,7 +55,7 @@ module Serverkit
|
|
60
55
|
end
|
61
56
|
|
62
57
|
def updatable?
|
63
|
-
|
58
|
+
state == "updated" && !updated?
|
64
59
|
end
|
65
60
|
|
66
61
|
def update
|
@@ -6,22 +6,16 @@ module Serverkit
|
|
6
6
|
attribute :destination, required: true, type: String
|
7
7
|
attribute :source, required: true, type: String
|
8
8
|
|
9
|
+
# @note Specinfra's #link_to command does not support -f option for now
|
9
10
|
# @note Override
|
10
11
|
def apply
|
11
|
-
|
12
|
+
run_command("ln -fs #{destination} #{source}")
|
12
13
|
end
|
13
14
|
|
14
15
|
# @note Override
|
15
16
|
def check
|
16
17
|
check_command_from_identifier(:check_file_is_linked_to, source, destination)
|
17
18
|
end
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
# @note Override
|
22
|
-
def default_id
|
23
|
-
destination
|
24
|
-
end
|
25
19
|
end
|
26
20
|
end
|
27
21
|
end
|
data/lib/serverkit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -255,4 +255,3 @@ signing_key:
|
|
255
255
|
specification_version: 4
|
256
256
|
summary: Configuration management toolkit for IT automation.
|
257
257
|
test_files: []
|
258
|
-
has_rdoc:
|