Created
September 19, 2012 23:09
-
-
Save thehar/3752940 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cookbook Name:: jenkins | |
# Recipe:: default | |
# Copyright 2012, Lookout Inc. | |
# All rights reserved - Do Not Redistribute | |
include_recipe("apt") | |
apt_repository "jenkins" do | |
uri "http://pkg.jenkins-ci.org/debian" | |
components ["binary"] | |
key "http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key" | |
action :add | |
notifies :run, resources(:execute => "apt-get update"), :immediately | |
end | |
package "jenkins" do | |
action :install | |
end | |
cookbook_file "/var/lib/jenkins/.keystore" do | |
source "keystore.erb" | |
owner "jenkins" | |
group "nogroup" | |
mode "0644" | |
action :create | |
end | |
cookbook_file "/etc/default/jenkins" do | |
source "jenkins.erb" | |
owner "root" | |
group "root" | |
mode "0644" | |
notifies :restart, resources(:service => "jenkins"), :delayed | |
only_if do | |
cmd = Chef::ShellOut.new("grep -i HTTPS") | |
overview = cmd.run_command | |
Chef::Log.info overview.stdout | |
overview.stout.include?("Jenkins is going to be restarted with the new configuration") | |
end | |
action :nothing | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment