mirror of
https://gitlab.com/ydkn/capistrano-rails-console.git
synced 2023-02-13 20:54:14 -05:00
allow to set shell (refs #31)
This commit is contained in:
parent
99743c0ac3
commit
a14cc3660c
4 changed files with 15 additions and 7 deletions
|
@ -2,7 +2,8 @@
|
|||
|
||||
## Unreleased
|
||||
### Feature
|
||||
- Allow to set capistrano role to select server for remote console #33
|
||||
- allow to set capistrano role to select server for remote console (#33)
|
||||
- allow to set shell used on server (#31)
|
||||
|
||||
## 2.2.1 (2017-09-04)
|
||||
### Feature
|
||||
|
|
|
@ -72,6 +72,12 @@ set :console_user, nil # explicitly disable switching user through sudo
|
|||
set :console_role, :app # start remote console on primary server for this role
|
||||
```
|
||||
|
||||
### Shell
|
||||
|
||||
```ruby
|
||||
set :console_shell, '/bin/bash' # select shell to be used on server in case you experience problems (see #31)
|
||||
```
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|||
spec.require_paths = ['lib']
|
||||
|
||||
spec.add_dependency 'capistrano', '>= 3.5.0', '< 4.0.0'
|
||||
spec.add_dependency 'sshkit-interactive', '~> 0.2.0'
|
||||
spec.add_dependency 'sshkit-interactive', '~> 0.3.0'
|
||||
|
||||
spec.add_development_dependency 'bundler'
|
||||
spec.add_development_dependency 'rake'
|
||||
|
|
|
@ -10,6 +10,7 @@ namespace :load do
|
|||
set :console_env, -> { fetch(:rails_env, fetch(:stage, 'production')) }
|
||||
set :console_user, -> { fetch(:app_user, nil) }
|
||||
set :console_role, :app
|
||||
set :console_shell, nil
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -19,7 +20,7 @@ namespace :rails do
|
|||
args = []
|
||||
args << '--sandbox' if ENV.key?('sandbox') || ENV.key?('s')
|
||||
|
||||
run_interactively primary(fetch(:console_role)) do
|
||||
run_interactively primary(fetch(:console_role)), shell: fetch(:console_shell) do
|
||||
within current_path do
|
||||
as user: fetch(:console_user) do
|
||||
execute(:rails, :console, fetch(:console_env), *args)
|
||||
|
@ -30,7 +31,7 @@ namespace :rails do
|
|||
|
||||
desc 'Interact with a remote rails dbconsole'
|
||||
task :dbconsole do
|
||||
run_interactively primary(fetch(:console_role)) do
|
||||
run_interactively primary(fetch(:console_role)), shell: fetch(:console_shell) do
|
||||
within current_path do
|
||||
as user: fetch(:console_user) do
|
||||
execute(:rails, :dbconsole, '-p', '-e', fetch(:console_env))
|
||||
|
|
Loading…
Reference in a new issue