https://github.com/codesnik/rails-recipes
capistrano recipes for invoking rails script/console, script/dbconsole, rake etc.
https://github.com/codesnik/rails-recipes
Last synced: 6 months ago
JSON representation
capistrano recipes for invoking rails script/console, script/dbconsole, rake etc.
- Host: GitHub
- URL: https://github.com/codesnik/rails-recipes
- Owner: codesnik
- License: mit
- Created: 2009-07-22T03:13:15.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2009-07-22T03:15:16.000Z (over 16 years ago)
- Last Synced: 2025-08-09T20:18:53.981Z (6 months ago)
- Language: Ruby
- Size: 430 KB
- Stars: 10
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE
Awesome Lists containing this 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
Copyright (c) 2009 Alexey 'codesnik' Trofimenko. See LICENSE for details.