public
Created

  • Download Gist
warbler.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Warbler::Config.new do |config|
def create_war_name
begin
svn_url = `svn info --xml | xmllint --xpath /info/entry/url/text\\(\\) -`
svn_branch = svn_url.match(/https:\/\/myrepodomain\/svn\/general\/cwo_datasite\/(branches\/)?([^\/]*)\/cwo_data/)[2]
svn_revision = `svnversion .`.strip
svn_token = svn_branch + "~r" + svn_revision
puts "[" + svn_token + "]"
rescue
svn_token = "unknown_revision"
end
 
time_token = Time.new.strftime("%Y%m%d_%H%M")
puts "[" + time_token + "]"
war_name = "cwo_data_site" + "." + svn_token + "." + time_token
return war_name
end
 
def get_war_name
@war_name ||= create_war_name
end
 
config.jar_name = get_war_name
config.webxml.jruby.min.runtimes = 6
config.webxml.jruby.max.runtimes = 6
 
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.