demae 0.1.0 → 0.1.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/lib/demae/cli.rb +18 -7
- data/lib/demae/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: b383a563857cee104ebd38a5e61902e2cbd7e7b0
|
4
|
+
data.tar.gz: 420298e15ad816f1ce00e6c8fa87154a9fc97649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2430c1d38261367e117d73425bf6f74a300d1c7ec3e4f4debbfc8d66fbcddd3e0d70f343bf65c12a3a78c93e32c08ce7036d2f1f1eb31f484ff2a792e9a92db7
|
7
|
+
data.tar.gz: ef08a8f2b61417fa0aecb77133248fe873521db4a4b9fd8c6815d04f5e9ceeb4ff4af7678bcd387a12d66b7f54e7c3d94b547037578a95644214d714b54379ad
|
data/lib/demae/cli.rb
CHANGED
@@ -23,6 +23,21 @@ module Demae
|
|
23
23
|
|
24
24
|
desc 'apply', 'apply itamae recipes to environment'
|
25
25
|
def apply(environment)
|
26
|
+
run(environment)
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'plan', 'check an execution plan before apply cmd.'
|
30
|
+
def plan(environment)
|
31
|
+
run(environment, dry_run: true)
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def config_path(environment)
|
37
|
+
"#{CONFIG_DIR}/#{environment}.yml"
|
38
|
+
end
|
39
|
+
|
40
|
+
def run(environment, dry_run: false)
|
26
41
|
config = YAML.load_file(config_path(environment))
|
27
42
|
config.each do |server|
|
28
43
|
server['hosts'].each do |host|
|
@@ -30,21 +45,17 @@ module Demae
|
|
30
45
|
host: host,
|
31
46
|
vagrant: false,
|
32
47
|
ask_password: false,
|
33
|
-
sudo: true
|
48
|
+
sudo: true,
|
49
|
+
dry_run: dry_run
|
34
50
|
}
|
35
51
|
o = server.reject { |k, _| %w(hosts recipes).include? k }
|
36
52
|
o = o.each_with_object({}) { |(k, v), memo| memo[k.to_sym] = v }
|
37
53
|
options.merge!(o)
|
38
54
|
|
55
|
+
Itamae.logger.info "Target: #{host}"
|
39
56
|
runner = Itamae::Runner.run(server['recipes'], :ssh, options)
|
40
57
|
end
|
41
58
|
end
|
42
59
|
end
|
43
|
-
|
44
|
-
private
|
45
|
-
|
46
|
-
def config_path(environment)
|
47
|
-
"#{CONFIG_DIR}/#{environment}.yml"
|
48
|
-
end
|
49
60
|
end
|
50
61
|
end
|
data/lib/demae/version.rb
CHANGED