chake 0.14 → 0.15

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: 7fc582f75bf337561db2a9fdfaf16165cfe51410
4
- data.tar.gz: 4bd1f424fa51b0e0fa3abdb1b9d76feedb36398a
3
+ metadata.gz: 97aa2aa5205e9b1f7443dac44a1dd76820dd1075
4
+ data.tar.gz: 0ea452333ef4fce2a152aa437dde099940f18da0
5
5
  SHA512:
6
- metadata.gz: eb194cf2be96b080fbf009494f9bc4c8fa31e040d43a21364709128b55dd358240e0cd9f28f1e2606a65488c3637afade70ff9810a6b6e662bc974d1c16f40ec
7
- data.tar.gz: 53bf917170d3c9ad4734051a6589fac9ab09da860fbadd7080f8247efcddf0ec7da13ba18f0ddd50ad9728fd73cbc90a7d6725372b347729b67778491adaafc4
6
+ metadata.gz: b7107ef453e6f5289abb903055be87d5d63b9e8e411fc4884ef580e8f8a022c8d5dd895f6891728a8e81b028682b1198b28072e031a81b1d1a13a193bb86c842
7
+ data.tar.gz: 558c7a4e2b1e960beb1d2bacdc0ad8e74d871fc1411666b544d5c88266a2205de3422f1ebf8f324f5338b553e4643df78dd8e432795b32b2756795be85027b11
@@ -4,7 +4,9 @@ before_script:
4
4
  - bundle install --path .bundle
5
5
 
6
6
  tests:
7
- script: bundle exec rake
7
+ script:
8
+ - bundle exec rake
9
+ - bundle exec rake -f man/Rakefile
8
10
  cache:
9
11
  paths:
10
12
  - .bundle
@@ -1,3 +1,10 @@
1
+ # 0.15
2
+
3
+ * improve text in the parallel execution docs
4
+ * add new hook: `connect_common`, which will run before any attempt to connect
5
+ to any node.
6
+ * make output of `check` target more explicit about what was tested
7
+
1
8
  # 0.14
2
9
 
3
10
  * Fix typo in README.md
data/README.md CHANGED
@@ -120,12 +120,12 @@ $ rake check
120
120
 
121
121
  Note that by default all tasks that apply to all hosts will run in parallel,
122
122
  using rake's support for multitasks. If for some reason you need to prevent
123
- that, you can pass `-j1` (or --jobs=1`) in the rake invocation. Note that rake
124
- will by only run N+4 tasks in parallel, where N is the number of cores on the
125
- machine you are running it in. If you have more than N+4 hosts and want all of
126
- them to be handled in parallel, you might want o pass `-j` (or `--jobs`),
127
- without any number so that rake will have no limits on the number of tasks to
128
- perform in parallel.
123
+ that, you can pass `-j1` (or --jobs=1`) in the rake invocation. Note that by
124
+ default rake will only run N+4 tasks in parallel, where N is the number of
125
+ cores on the machine you are running it. If you have more than N+4 hosts and
126
+ want all of them to be handled in parallel, you might want o pass `-j` (or
127
+ `--jobs`), without any number, as the last argument; with that rake will have
128
+ no limit on the number of tasks to perform in parallel.
129
129
 
130
130
 
131
131
  To apply the configuration to all nodes, run
@@ -222,6 +222,9 @@ converging. To do this, you just need to enhance the corresponding tasks:
222
222
  already been bootstrapped)
223
223
  * `upload_common`: executed before uploading content to the node
224
224
  * `converge_common`: executed before converging (i.e. running chef)
225
+ * `connect_common`: executed before doing any action that connects to any of
226
+ the hosts. This can be used for example to generate a ssh configuration file
227
+ based on the contents of the nodes definition files.
225
228
 
226
229
  Example:
227
230
 
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ task 'build:tarball' => 'bundler:build' do
15
15
  end
16
16
 
17
17
  desc 'Create Debian source package'
18
- task 'build:debsrc' => ['build:tarball'] do
18
+ task 'build:debsrc' => ['bundler:clobber', 'build:tarball'] do
19
19
  dirname = "#{pkg.name}-#{pkg.version}"
20
20
  chdir 'pkg' do
21
21
  sh 'gem2deb', '--no-wnpp-check', '-s', '-p', pkg.name, "#{dirname}.tar.gz"
@@ -132,13 +132,16 @@ end
132
132
  bootstrap_steps = Dir.glob(File.expand_path('chake/bootstrap/*.sh', File.dirname(__FILE__))).sort
133
133
 
134
134
  desc 'Executed before bootstrapping'
135
- task :bootstrap_common
135
+ task :bootstrap_common => :connect_common
136
136
 
137
137
  desc 'Executed before uploading'
138
- task :upload_common
138
+ task :upload_common => :connect_common
139
139
 
140
140
  desc 'Executed before uploading'
141
- task :converge_common
141
+ task :converge_common => :connect_common
142
+
143
+ desc 'Executed before connecting to any host'
144
+ task :connect_common
142
145
 
143
146
  $nodes.each do |node|
144
147
 
@@ -223,24 +226,24 @@ $nodes.each do |node|
223
226
  end
224
227
 
225
228
  desc 'apply <recipe> on #{hostname}'
226
- task "apply:#{hostname}", [:recipe] => [:recipe_input] do |task, args|
229
+ task "apply:#{hostname}", [:recipe] => [:recipe_input, :connect_common] do |task, args|
227
230
  chef_logging = Rake.application.options.silent && '-l fatal' || ''
228
231
  node.run_as_root "chef-solo -c #{node.path}/#{chef_config} #{chef_logging} -j #{node.path}/#{$chake_tmpdir}/#{hostname}.json --override-runlist recipe[#{$recipe_to_apply}]"
229
232
  end
230
233
  task "apply:#{hostname}" => converge_dependencies
231
234
 
232
235
  desc "run a command on #{hostname}"
233
- task "run:#{hostname}", [:command] => [:run_input] do
236
+ task "run:#{hostname}", [:command] => [:run_input, :connect_common] do
234
237
  node.run($cmd_to_run)
235
238
  end
236
239
 
237
240
  desc "Logs in to a shell on #{hostname}"
238
- task "login:#{hostname}" do
241
+ task "login:#{hostname}" => :connect_common do
239
242
  node.run_shell
240
243
  end
241
244
 
242
245
  desc 'checks connectivity and setup on all nodes'
243
- task "check:#{hostname}" do
246
+ task "check:#{hostname}" => :connect_common do
244
247
  node.run('sudo true')
245
248
  end
246
249
 
@@ -308,4 +311,6 @@ task :default => :converge
308
311
  desc 'checks connectivity and setup on all nodes'
309
312
  multitask :check => ($nodes.map { |node| "check:#{node.hostname}" }) do
310
313
  puts "✓ all hosts OK"
314
+ puts " - ssh connection works"
315
+ puts " - password-less sudo works"
311
316
  end
@@ -1,3 +1,3 @@
1
1
  module Chake
2
- VERSION = "0.14"
2
+ VERSION = "0.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chake
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.14'
4
+ version: '0.15'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antonio Terceiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-19 00:00:00.000000000 Z
11
+ date: 2016-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler