Permalink
Browse files

Merge pull request #14 from patcon/fnichol-13

[Issue #13] Added http_request so plugins only downloaded when updated. (
  • Loading branch information...
2 parents 24a8048 + 7cb9c13 commit 071d97aba06c74717f1d3f06d528c580d19265d0 @fnichol fnichol committed Dec 5, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 recipes/default.rb
View
@@ -64,6 +64,17 @@
backup false
owner node[:jenkins][:server][:user]
group node[:jenkins][:server][:group]
+ action :nothing
+ end
+
+ http_request "HEAD #{node[:jenkins][:mirror]}/latest/#{name}.hpi" do
+ message ""
+ url "#{node[:jenkins][:mirror]}/latest/#{name}.hpi"
+ action :head
+ if File.exists?("#{node[:jenkins][:server][:home]}/plugins/#{name}.hpi")
+ headers "If-Modified-Since" => File.mtime("#{node[:jenkins][:server][:home]}/plugins/#{name}.hpi").httpdate
+ end
+ notifies :create, resources(:remote_file => "#{node[:jenkins][:server][:home]}/plugins/#{name}.hpi"), :immediately
end
end

0 comments on commit 071d97a

Please sign in to comment.