Sha256: bb2a773dc31c82c1a3205aaf0e11528ae7c14e00a923a01931dad52b9cf9ed39

Contents?: true

Size: 1.57 KB

Versions: 6

Compression:

Stored size: 1.57 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

6 entries across 6 versions & 1 rubygems

Version Path
lobot-0.9.7 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/jenkins.rb
lobot-0.9.6 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/jenkins.rb
lobot-0.9.5 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/jenkins.rb
lobot-0.9.4 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/jenkins.rb
lobot-0.9.2 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/jenkins.rb
lobot-0.9.0 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/jenkins.rb