Skip to content

Commit

Permalink
Merge pull request heavywater#14 from patcon/fnichol-13
Browse files Browse the repository at this point in the history
[Issue heavywater#13] Added http_request so plugins only downloaded when updated. (
  • Loading branch information
fnichol committed Dec 5, 2011
2 parents 24a8048 + 7cb9c13 commit 071d97a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 071d97a

Please sign in to comment.