Add the tooling to actually run a war inside of tomcat

Fixes #1
This commit is contained in:
R. Tyler Croy 2014-07-28 16:04:38 -07:00
parent cae214ae53
commit 4f09a9c40b
4 changed files with 46 additions and 2 deletions

View File

@ -69,7 +69,7 @@ war {
manifest { attributes 'Main-Class': 'WarMain' }
webInf {
from 'vendor/gems', 'vendor/specifications', 'vendor/bin'
from 'vendor'
into 'gems'
}

View File

@ -4,7 +4,10 @@ end
# Hack our GEM_HOME to make sure that the `rubygems` support can find our
# unpacked gems in ./vendor/
ENV['GEM_HOME'] = File.expand_path(File.dirname(__FILE__) + '/vendor')
vendored_gems = File.expand_path(File.dirname(__FILE__) + '/vendor')
if File.exists?(vendored_gems)
ENV['GEM_HOME'] = vendored_gems
end
jar_cache = File.expand_path(File.dirname(__FILE__) + '/.jarcache/')
if File.exists?(jar_cache)

View File

@ -0,0 +1,5 @@
require 'app'
map '/' do
run Sinatra::Application
end

View File

@ -0,0 +1,36 @@
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>public.root</param-name>
<param-value>/</param-value>
</context-param>
<context-param>
<param-name>rack.env</param-name>
<param-value>production</param-value>
</context-param>
<context-param>
<param-name>jruby.compat.version</param-name>
<param-value>1.9</param-value>
</context-param>
<filter>
<filter-name>RackFilter</filter-name>
<filter-class>org.jruby.rack.RackFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>RackFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.jruby.rack.RackServletContextListener</listener-class>
</listener>
</web-app>