bluepill-rb / bluepill

simple process monitoring tool
MIT License
416 stars 52 forks source link

Before and start hook commands #2

Open brauliobo opened 10 years ago

brauliobo commented 10 years ago

Hello all,

I need some before and start commands on thin execution. For example, before thin I need to run:

rm -fr public/javascripts/cache*
rm -fr public/stylesheets/cache*

And after I need to run

 renice 20 `cat tmp/pids/thin.50003.pid`

How can I code these after/before scripts?

ldnunes commented 10 years ago

You can add this to the top of your .pill file (not tested, be careful):

require 'fileutils'

app_root = REPLACE_THIS_FOR_YOUR_APP_ROOT_DIR FileUtils.rm_rf File.join(approot, 'public/stylesheets/cache') FileUtils.rm_rf File.join(approot, 'public/javascript/cache')

2013/11/26 Bráulio Bhavamitra notifications@github.com

Hello all,

I need some before and start commands on thin execution. For example, before thin I need to run:

rm -fr public/javascripts/cache rm -fr public/stylesheets/cache

And after I need to run

renice 20 cat tmp/pids/thin.50003.pid

How can I code these after/before scripts?

— Reply to this email directly or view it on GitHubhttps://github.com/bluepill-rb/bluepill/issues/2 .

Lucas Dutra Nunes

brauliobo commented 10 years ago

@ldnunes this need to be run before each thin start

ldnunes commented 10 years ago

Oh, my bad, I didn't read your issue correctly.

Isn't there a before/after method for the thin server? Perhaps you could use that for what you need.

2013/11/26 Bráulio Bhavamitra notifications@github.com

@ldnunes https://github.com/ldnunes this need to be run before _each_thin start

— Reply to this email directly or view it on GitHubhttps://github.com/bluepill-rb/bluepill/issues/2#issuecomment-29316243 .

Lucas Dutra Nunes

brauliobo commented 10 years ago

are there a application start/stop callbacks? that would be perfect!