Sha256: aa1d3c327c875baba35d5121ab1cdc437bd3d1308c7ee8f0ddad47381109ad6f
Contents?: true
Size: 1.17 KB
Versions: 19
Compression:
Stored size: 1.17 KB
Contents
require 'fileutils' require File.expand_path(File.dirname(__FILE__) + '/../utilities') Capistrano::Configuration.instance(true).load do default_run_options[:pty] = true set :use_sudo, true # TOMCAT SERVERS _cset :tomcat_home, "/usr/local/apache-tomcat-6.0.29" _cset :tomcat_ctrl, "/etc/init.d/tomcat" _cset :java_home, "/usr/lib/jvm/java" set :tomcat_user do user # default use current user. end # # simple interactions with the tomcat server # namespace :tomcat do desc "install tomcat" task :install, :role => :app do dir = File.dirname(tomcat_home) basename = File.basename(tomcat_file) basectl = File.basename(tomcat_ctrl) utilities.sudo_upload "#{tomcat_file}", "#{dir}/#{basename}" run "cd /tmp" sudo "mkdir -p #{dir}" sudo "tar -zvxf #{dir}/#{basename} -C #{dir}" sudo "chown #{tomcat_user}:root #{tomcat_home} -R" put utilities.render("tomcat", binding), "/tmp/tomcat.tmp" sudo "cp /tmp/tomcat.tmp #{tomcat_ctrl}" sudo "chmod a+x #{tomcat_ctrl}" sudo "/sbin/chkconfig --add #{basectl}" run "rm /tmp/tomcat.tmp" sudo "rm #{dir}/#{basename}" end end end
Version data entries
19 entries across 19 versions & 1 rubygems