0.01
No commit activity in last 3 years
No release in over 3 years
capistrano recipes for invoking rails console, rails dbconsole and rake on a rails app server
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

rails-recipes¶ ↑

capistrano recipes for invoking rails script/console, script/dbconsole, rake etc. on first server in a cluster

Synopsis¶ ↑

starts script/console on the first :app server in currently released directory be careful with your production server data - it’s the power under your fingers now!

cap rails:console

starts script/dbconsole, still on the :app server, but connected to a right database, probably

cap rails:dbconsole

even this should work, providing you authenticate via ssh key and you’re not using ssh gateway (breaks pipeline sometimes)

cap rails:dbconsole < sqldump.sql

sorry, haven’t figured how to provide additional arguments for rake yet.

cap rails:rake task=db:abort_if_pending_migrations

(NOT DONE YET) do not try it at work

(NOT DONE YET) cap rails:runner cmd='User.delete_all'

using some multistage deployment scheme (capistrano/ext/multistage or something homebrew)? this should work too right from the box

cap staging rails:console

Installation¶ ↑

sudo gem install codesnik-rails-recipes --source=http://gems.github.com

then stick

require 'rails-recipes'

at the end of your Capfile or ~/.caprc

Configuration¶ ↑

TODO

Hidden details¶ ↑

It doesn’t use ruby net/ssh2 library for interactive script/console and script/dbconsole but invokes real ‘ssh’ executable so that readline interface works as expected. Still this means that all the subtile differences of parsing ~/.ssh/config and other files between openssh executables and net/ssh2 apply here.

Used on Ubuntu and MacOS X, for deployment on Gentoo, Fedora, FreeBSD

Sorry, no tests yet, not that there’s much code you can actually test here

Suggestions, feature requests, bugreports¶ ↑

…are always welcome.

Copyright © 2009 Alexey ‘codesnik’ Trofimenko. See LICENSE for details.