Sha256: 23f8217fa45d71af41eb6012feec371c8fc4def4abc06c5632900d2975955d95
Contents?: true
Size: 1.86 KB
Versions: 51
Compression:
Stored size: 1.86 KB
Contents
module Publisher class Tomcat attr_accessor :servers attr_accessor :runners attr_accessor :initd_script attr_accessor :application_name attr_accessor :catalina_home attr_accessor :tomcat_context attr_accessor :logfilename attr_accessor :check_host attr_accessor :worker def deploy(options={}) Helper.validates_presence_of servers, "servers not set" Helper.validates_presence_of runners, "runners not set" Helper.validates_presence_of initd_script, "initd_script not set" Helper.validates_presence_of application_name, "application_name not set" Helper.validates_presence_of catalina_home, "catalina_home not set" Helper.validates_presence_of tomcat_context, "tomcat_context not set" Helper.validates_presence_of logfilename, "logfilename not set" Helper.validates_presence_of check_host, "check_host not set" servers.each do |server| $log.writer.info "========== Processing #{server}" is_runner = runners.include?(server) if is_runner $log.writer.info "Stopping tomcat on #{server}" stdout = worker.remote_execute("sudo #{initd_script} stop", :remote_host => server) $log.writer.info stdout end $log.writer.info "Deploying to webapp" worker.rsync("target/#{application_name}/", "#{catalina_home}/webapps/#{tomcat_context}", :remote_host => server) if is_runner $log.writer.info "Starting tomcat on #{server}" stdout = worker.remote_execute("sudo #{initd_script} start", :remote_host => server) $log.writer.info stdout stdout = worker.remote_execute("sleep 10; tail -50 #{catalina_home}/logs/#{logfilename}", :remote_host => server) $log.writer.debug stdout worker.assert_url_response_of(:check_host => check_host) end end end end end
Version data entries
51 entries across 51 versions & 1 rubygems