This gem adds some handy capistrano tasks (for now)
Add this line to your application's Gemfile:
gem 'rails51', github: 'coders51/rails51'
To use capistrano tasks in your project add this line in your Capfile
require 'rails51/capistrano'
This task imports in local postgres database a remote dump. Just call
cap production pg:import
This will:
- Dump the database on the server with
--clean and --no-owner
flags, and gzips it. Fetch database name and eventually port from:release_path/config/database.yml
file - Download the file and uncompress
- Import in the database defined in local
database.yml
file
New
- Password authentication now available. The task will attempt to create the appropriate
~/.pgpass
file. Feel free to report any issue
This task imports in local mysql database a remote dump. Just call
cap production mysql:import
This will:
- Dump the database on the server and gzips it. Fetch database name, user, password and eventually port from
:release_path/config/database.yml
file - Download the file and uncompress
- Import in the database defined in local
database.yml
file
This task simply stream the tail -f
results of log/#{fetch(:rails_env, 'production')}.log
file locally.
Known Issues: If you use Airbrussh, you won't see anything because all the stdout is sent to log/capistrano.log
. You can either use my fork or wait for this pr to be merged.
Inspired (and mostly copied) from capistrano-rails-console this task allows you to launch a rails console
in the target environment without the need of ssh, find the right directory, RAILS_ENV etc etc...
Just type
cap production rails:console
and you will have your console.
- Fork it ( https://github.com/[my-github-username]/rails51/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request