Jay Godse
Jay Godse

Reputation: 15503

JRuby : Rails : Warbler - How to distribute executable scripts within the war file

I have a JRuby/Rails application which I deploy to a Tomcat using the Warbler gem.

In the JRuby application, I have a bunch of scripts in $RUBY_ROOT/lib/tasks which are used for install scripts, cron jobs, Resque, etc.

When I develop/build the files, I set permissions for these scripts to executable

$lib/tasks> chmod a+x install.sh

However, when I distribute the war file to the Tomcat, and fire it up, the file under the exploded directory ( ...WEB-INF/lib/tasks/install.sh) shows install.sh does not have executable privileges.

Is there a way to tell warbler to leave lib/tasks/install.sh with executable privileges?

Upvotes: 2

Views: 295

Answers (1)

kares
kares

Reputation: 7166

for the record (anyone landing here) : this is not possible with zip files currently at least not with Java's built-in zip support.

also I think this is somehow an "abuse" of a .war file - it's meant to be a deployable application unit although there's lately the ability to run it "standalone" e.g. with migrations java -jar my.war -S rake db:migrate setting up cron jobs from a .war sounds a bit too much but if you really want it you now can ( using rake tasks :)

Upvotes: 1

Related Questions