On 4/6/06, Michael E. email@example.com wrote:
I’m attempting to auto deploy a rails application to a development
server periodically during ongoing development. I’ve setup ssh keys
to allow the proper user auto login permissions, but have ran into 2
I have completely different setup for this which might interest you.
I’m using svn hooks with a cron script to auto export on EVERY commit.
It does a lot of other things as well - backup, email notification,
reload of the DB structure, reload of fixtures. This way I have a
deployed app on every change. It’s very easy to do with svn hooks and
some ruby/bash scripts.
- When the script is run from a cron job as the same user as I
currently manually deploy from I receive an error when reaper tries to
execute - “can’t get terminal parameters (Inappropriate ioctl for
device)”. I’m assuming that the reaper script is trying to capture
the PIDs to restart on the remote server and cannot since there is no
terminal running. Is there way give a virtual terminal to be used?
This maybe just Linux related question -but thought I’d start on the
You can run sudo with -l which gives sudo a login shell to work in. I
find it’s usually better this way, as I can also set environment vars
in the ~/.bash_profile to set things like the rails environment. See
if that also solves your problem.
If you are running a system with SELinux active, there are even more
complications, so be careful with that.
- Periodically when the “sudo reaper” portion runs during deployment,
a password prompt will display and the password will need to be
entered. What causes the password prompt -according the docs the sudo
commands will use the same credentials in the auto login or previously
entered when the rake deploy command first starts.
That’s actually settable in your sudoers file. You can let it run
passwordless if you want (but then limit the commands to be
executed!), or you can set a timeout for the password, so that it’ll
ask for it the first time only, and remember it for the duration of
the timeout. If you give something like 3-5 minutes of timeout, you
should be able to easily deploy with only one password entry.
I have in my blog some info about using sudo for rails deployment:
And I can give you some help in fine tuning it for your environment.
Family management on rails: http://www.famundo.com - coming soon!
My development related blog: http://devblog.famundo.com