Sha256: ae2339d6e40d3f044a059bc764a5ff721150e398c70da7fbcc756d0ec9c5d1c3

Contents?: true

Size: 1.58 KB

Versions: 2

Compression:

Stored size: 1.58 KB

Contents

include_recipe "pivotal_server::daemontools"
include_recipe "pivotal_ci::xvfb"
include_recipe "pivotal_ci::git_config"

username = ENV['SUDO_USER'].strip
user_home = ENV['HOME']

install_dir = "/usr/local/jenkins"
bin_location = "#{install_dir}/jenkins.war"

execute "download jenkins" do
  command "mkdir -p #{install_dir} && curl -Lsf http://mirrors.jenkins-ci.org/war/latest/jenkins.war -o #{bin_location}"
  not_if { File.exists?(bin_location) }
end

execute "download git plugin" do
  command "mkdir -p /home/#{username}/.jenkins/plugins && curl -Lsf http://mirrors.jenkins-ci.org/plugins/git/latest/git.hpi -o /home/#{username}/.jenkins/plugins/git.hpi"
  not_if { File.exists?("/home/#{username}/.jenkins/plugins/git.hpi") }
  user username
end

execute "make projec#t dir" do
  command "mkdir -p /home/#{username}/.jenkins/jobs/#{ENV['APP_NAME']}"
  user username
end

template "/home/#{username}/.jenkins/jobs/#{ENV['APP_NAME']}/config.xml" do
  source "jenkins-job-config.xml.erb"
  owner username
end

service_name = "jenkins"

execute "create daemontools directory" do
  command "mkdir -p /service/#{service_name}"
end

execute "create run script2" do # srsly! the not_if from mysql was being applied because they had the same name. I kid you not.
  command "echo -e '#!/bin/sh\nexport PATH=/usr/local/mysql/bin/:$PATH\nexport HOME=/home/#{username}\nexec /command/setuidgid #{username}  /usr/bin/java -jar #{bin_location}' > /service/#{service_name}/run"
  # not_if "ls /service/#{service_name}/run"
end

execute "make run script executable" do
  command "chmod 755 /service/#{service_name}/run"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lobot-0.10.1 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/jenkins.rb
lobot-0.10.0 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/jenkins.rb