1
0
Fork 0
mirror of https://gitlab.com/ydkn/capistrano-rails-console.git synced 2023-02-13 20:54:14 -05:00
No description
Find a file
Florian Schwab 1fd05219ce * add missing rubocop-performance dependency to gemspec
* set targeted ruby version for rubocop to 2.4
2019-08-23 11:05:44 +02:00
lib improve code style 2018-10-07 15:16:37 +02:00
.gitignore add security scans to ci pipeline 2018-10-07 15:00:27 +02:00
.gitlab-ci.yml update ci 2019-06-19 11:27:48 +02:00
.rubocop.yml * add missing rubocop-performance dependency to gemspec 2019-08-23 11:05:44 +02:00
capistrano-rails-console.gemspec * add missing rubocop-performance dependency to gemspec 2019-08-23 11:05:44 +02:00
CHANGELOG.md update changelog 2019-06-19 11:27:54 +02:00
Gemfile improve code style 2018-10-07 15:16:37 +02:00
LICENSE.txt initial import 2013-11-09 15:58:59 +01:00
Rakefile improve code style 2018-10-07 15:16:37 +02:00
README.md move to gitlab 2018-06-09 18:37:36 +02:00

Capistrano::Rails::Console

Remote rails console and dbconsole for capistrano.

Installation

Add this line to your application's Gemfile:

gem 'capistrano-rails-console', require: false

And then execute:

$ bundle

Or install it yourself as:

$ gem install capistrano-rails-console

Usage

You should ensure there is a rails binstub in the current/bin directory on the server otherwise this gem won't work (because rails itself won't work). If you experience any problems please verify that manually running rails console on the server does work. If it doesn't you are deploying your rails application wrong (check #18 or #26 for details)!

Require in Capfile to use the default task:

require 'capistrano/rails/console'

Run a remote rails console with:

$ cap production rails:console
$ cap production rails:c

You can also start a sandbox session:

$ cap production rails:console sandbox=1

Or run a dbconsole:

$ cap production rails:dbconsole
$ cap production rails:db

Options

Rails environment

set :console_env, :production # use different environment than deployment environment (rails_env)

User

set :console_user, :appuser # run rails console as appuser through sudo
set :console_user, nil # explicitly disable switching user through sudo

Role

set :console_role, :app # start remote console on primary server for this role

Shell

set :console_shell, '/bin/bash' # select shell to be used on server in case you experience problems (see #31)

Contributing

Bug reports and pull requests are welcome on GitLab at https://gitlab.com/ydkn/capistrano-rails-console.

License

The gem is available as open source under the terms of the MIT License.