Sha256: c9e4c0d24cf3ce96d93cf202e5c6f3d11a18d0df814dcf9149499fd5d63aa395
Contents?: true
Size: 1.17 KB
Versions: 5
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
5 entries across 5 versions & 1 rubygems