Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Before and start hook commands #2

Open
brauliobo opened this issue Nov 26, 2013 · 4 comments
Open

Before and start hook commands #2

brauliobo opened this issue Nov 26, 2013 · 4 comments

Comments

@brauliobo
Copy link

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
Copy link

ldnunes commented Nov 26, 2013

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(app_root, 'public/stylesheets/cache_')
FileUtils.rm_rf File.join(app_root, 'public/javascript/cache_')

2013/11/26 Bráulio Bhavamitra [email protected]

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//issues/2
.

Lucas Dutra Nunes

@brauliobo
Copy link
Author

@ldnunes this need to be run before each thin start

@ldnunes
Copy link

ldnunes commented Nov 26, 2013

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 [email protected]

@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//issues/2#issuecomment-29316243
.

Lucas Dutra Nunes

@brauliobo
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants