Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time zone support to chef-jenkins #24

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
default[:jenkins][:package_url] = "http://pkg.jenkins-ci.org"
default[:jenkins][:java_home] = ENV['JAVA_HOME']

# Set time zone by default to UTC. Set to your own time zone by using your Java Time Zone Code
# (ex. "America/Vancouver").
default[:jenkins][:time_zone] = "-Dorg.apache.commons.jelly.tags.fmt.timeZone=Etc/UTC"

default[:jenkins][:server][:home] = "/var/lib/jenkins"
default[:jenkins][:server][:user] = "jenkins"

Expand Down
13 changes: 13 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,19 @@

template "/etc/default/jenkins"

file "/etc/sysconfig/jenkins" do
action :delete
only_if {File.exists?("/etc/sysconfig/jenkins")}
end

link "/etc/default/jenkins" do
to "/etc/sysconfig/jenkins"
link_type :symbolic
owner "root"
group "root"
action :create
end

package "jenkins" do
action :nothing
notifies :create, "template[/etc/default/jenkins]", :immediately
Expand Down
3 changes: 3 additions & 0 deletions templates/default/jenkins.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ JAVA=/usr/bin/java
#JAVA_ARGS="-Xmx256m"
#JAVA_ARGS="-Djava.net.preferIPv4Stack=true" # make jenkins listen on IPv4 address

# Options to pass to Java when running Jenkins.
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true <%= node.jenkins.time_zone %>"

PIDFILE=/var/run/jenkins/jenkins.pid

# user id to be invoked as (otherwise will run as root; not wise!)
Expand Down