The JENKINS_HOME environment variable doesn't get set. It should however be set using the template "default_jenkins.erb"
whenever I go into the instance and echo $JENKINS_HOME it does not return anything
Currently it successfully takes the jenkins war from the remote location and places it into the webapps directory of Tomcat. When I go to the http://PublicDNS:8080/jenkins Jenkins is running. (It does however complain about not being able to create .jenkins directory, AKA Jenkins Home, and suggests that there is a problem with its permissions)
# Setting local variables
jenkinsWar = node[:jenkins][:war]
webapp_dir = node["tomcat"]["webapp_dir"]
tomcat_user = node["tomcat"]["user"]
tomcat_group = node["tomcat"]["group"]
# Getting the Jenkins.war and putting it into the tomcat webapps directory
remote_file "/#{webapp_dir}/#{jenkinsWar}" do
source "#{node[:jenkins][:url]}"
mode "0644"
owner "root"
group "root"
end
# Setting Jenkins configuration
template "/etc/default/jenkins" do
source "default_jenkins.erb"
owner "root"
group "root"
mode "0644"
notifies :restart, resources(:service => "tomcat")
end
# Set Jenkins home variable. This will tell Jenkins where to find it's jobs/plugins/etc
JENKINS_HOME=<%= node[:jenkins][:home] %>
default[:jenkins][:war] = "jenkins.war"
default[:jenkins][:home] = "/var/lib/jenkins"
default[:jenkins][:url] = "https://s3.amazonaws.com/cookbook-resources/#{node[:jenkins][:war]}"
Archive powered by MHonArc 2.6.16.