itamae 1.2.11 → 1.2.12

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: abc46228492e8429a26e851015522f897ded712f
4
- data.tar.gz: ad1644cef5cfe63cd651ebfcd1a41607c63fe1f6
3
+ metadata.gz: 47fe6f419701b8d6ea5e8e83de69f6ec2a613b84
4
+ data.tar.gz: 4575a36969617f23fa01d53f058b2061bef21b2f
5
5
  SHA512:
6
- metadata.gz: c035e7f0e949cadbb6f6338668501bbff39e8892e7662e8570f333f6ede71e2b7f323e6a78041795d18816deacadffe00ac0f0fe4e2830048d7a3a02ccddb338
7
- data.tar.gz: 4f7e22d682411a50334b4d18b318e611fd3ff40160f3d6d27cb882b4ef426ee19294adf552c792a3dd6de06bbcacbd3dff86faaee427e1b95d25bd8236366708
6
+ metadata.gz: 4903252764a33d19b67966d9b8b3243ae886b1b1e0e8dc61610afd35b93aa77f3cf62d8f72a270ec327344564bdf56b489efc3708d8975701ca50e8355057423
7
+ data.tar.gz: a4977c7fd756974df71c798a7d4034f76026239f1a9baf5291c3d70ff2df0859b6be4133236ba8d0029dfb5088ad83d8827bec5c1ae36af126be9644f2f352e1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## v1.2.12
2
+
3
+ Bugfixes
4
+
5
+ - Run delayed notifications created by a delayed notification.
6
+ - Set updated false after executing resources.
7
+
1
8
  ## v1.2.11
2
9
 
3
10
  Bugfixes
data/lib/itamae/recipe.rb CHANGED
@@ -46,17 +46,22 @@ module Itamae
46
46
 
47
47
  Logger.formatter.with_indent do
48
48
  @children.run(options)
49
-
50
- @delayed_notifications.uniq do |notification|
51
- [notification.action, notification.action_resource]
52
- end.each do |notification|
53
- notification.run(options)
54
- end
49
+ run_delayed_notifications(options)
55
50
  end
56
51
  end
57
52
 
58
53
  private
59
54
 
55
+ def run_delayed_notifications(options)
56
+ @delayed_notifications.uniq! do |notification|
57
+ [notification.action, notification.action_resource]
58
+ end
59
+
60
+ while notification = @delayed_notifications.shift
61
+ notification.run(options)
62
+ end
63
+ end
64
+
60
65
  def show_banner
61
66
  Logger.info "Recipe: #{@path}"
62
67
  end
@@ -134,6 +134,8 @@ module Itamae
134
134
  verify unless options[:dry_run]
135
135
  notify(options) if updated?
136
136
  end
137
+
138
+ @updated = false
137
139
  rescue Backend::CommandExecutionError
138
140
  Logger.error "#{resource_type}[#{resource_name}] Failed."
139
141
  exit 2
@@ -1 +1 @@
1
- 1.2.11
1
+ 1.2.12
@@ -135,3 +135,13 @@ describe file('/tmp/remote_file_in_definition') do
135
135
  it { should be_file }
136
136
  its(:content) { should eq("definition_example\n") }
137
137
  end
138
+
139
+ describe file('/tmp/multi_delayed_notifies') do
140
+ it { should be_file }
141
+ its(:content) { should eq("1\n2\n3\n4\n") }
142
+ end
143
+
144
+ describe file('/tmp/multi_immediately_notifies') do
145
+ it { should be_file }
146
+ its(:content) { should eq("1\n2\n3\n4\n") }
147
+ end
@@ -236,3 +236,42 @@ execute 'true' do
236
236
  verify 'true'
237
237
  end
238
238
 
239
+ #####
240
+
241
+ execute 'echo 1 > /tmp/multi_delayed_notifies' do
242
+ notifies :run, "execute[echo 2 >> /tmp/multi_delayed_notifies]"
243
+ end
244
+
245
+ execute 'echo 2 >> /tmp/multi_delayed_notifies' do
246
+ action :nothing
247
+ notifies :run, "execute[echo 3 >> /tmp/multi_delayed_notifies]"
248
+ end
249
+
250
+ execute 'echo 3 >> /tmp/multi_delayed_notifies' do
251
+ action :nothing
252
+ notifies :run, "execute[echo 4 >> /tmp/multi_delayed_notifies]"
253
+ end
254
+
255
+ execute 'echo 4 >> /tmp/multi_delayed_notifies' do
256
+ action :nothing
257
+ end
258
+
259
+ #####
260
+
261
+ execute 'echo 1 > /tmp/multi_immediately_notifies' do
262
+ notifies :run, "execute[echo 2 >> /tmp/multi_immediately_notifies]", :immediately
263
+ end
264
+
265
+ execute 'echo 2 >> /tmp/multi_immediately_notifies' do
266
+ action :nothing
267
+ notifies :run, "execute[echo 3 >> /tmp/multi_immediately_notifies]", :immediately
268
+ end
269
+
270
+ execute 'echo 3 >> /tmp/multi_immediately_notifies' do
271
+ action :nothing
272
+ notifies :run, "execute[echo 4 >> /tmp/multi_immediately_notifies]", :immediately
273
+ end
274
+
275
+ execute 'echo 4 >> /tmp/multi_immediately_notifies' do
276
+ action :nothing
277
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.11
4
+ version: 1.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-03 00:00:00.000000000 Z
11
+ date: 2015-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -262,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
262
  version: '0'
263
263
  requirements: []
264
264
  rubyforge_project:
265
- rubygems_version: 2.4.5
265
+ rubygems_version: 2.2.2
266
266
  signing_key:
267
267
  specification_version: 4
268
268
  summary: Simple Configuration Management Tool