I just deployed my first rails app to one of my secondary domains on TextDrive’s shared hosting space.
If that sounds like a recipe for disaster….you’re right!
While Rails is a great development tool, there’s lots of work to do in simplifying, stabilizing, and documenting the deployment process. The app in question is very, very tiny for the express purpose of getting deployment nailed. In fact, it’s taken me longer to deploy than to develop.
For you, and Future Garrick, here’s the process.
- Freeze Rails so you’re not plagued with different-version-itis:
rake rails:freeze:edge TAG=rel_-2-3
- Create an Subversion repository in your primary domain,
Not in your secondary domain. If the repository is in a secondary domain, your primary account can’t see it. Using your primary domain and primary account is easier – if not as tidy as I’d like.
- Give your primary account access to the new Subversion repository.
- Grab the TextDrive deploy.rb from nuby on rails. Verify
- Do the initial import into the repository and an initial checkout back to your local machine.
cdto your local app and run
cap setup. Confirm you now have a
/web/shareddirectory. It should contain the following directories: log, pids, and system. In
logyou should have at least
fastcgi.crash.log. Create and chmod them to 666 if they don’t exist.
- Follow TextDrive’s instructions for setting up lighttpd, rails, and a proxy.
- Change the
/web/public/paths in APPNAME.conf and rails.sh to
- Follow TextDrive’s instructions to start up lighttpd and rails.
Running their rails.sh file didn’t work for me, editing and manually running the script did.
After all this,
cap deploy will deploy your app for you as advertised.
After I tweak a couple more dials and flip a couple more switches I’ll point you to the app.
2 Replies to “How To Deploy Rails with SVN and Capistrano to a Secondary Domain on TextDrive”
Thanks for writing this up! I have some questions for you if you don’t mind.
The shovel script you reference says that it creates a “sites” directory that will hold installations of deployed websites. But, you aren’t using this feature, right?
Aren’t you just installing inside the /web and /web/public folders of a domain you created on textdrive?
How did you get around all the little differences the shovel script has from how textdrive tell you to set things up?
Thanks for the comment, and yes you’re correct. The article actually describes how I reconciled the differences between the shovel script and textdrive (changing directory paths to /web and /web/public, ect.)
Comments are closed.