Start remote Rails console on primary host
This commit is contained in:
@@ -47,6 +47,10 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
||||
*command
|
||||
end
|
||||
|
||||
def console
|
||||
"ssh -t #{config.ssh_user}@#{config.primary_host} 'docker exec -it -e RAILS_MASTER_KEY=#{config.master_key} #{config.env_args.join(" ")} #{config.service_with_version} bin/rails c'"
|
||||
end
|
||||
|
||||
def list_containers
|
||||
docker :container, :ls, "-a", *service_filter
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ require "active_support/core_ext/string/inquiry"
|
||||
require "erb"
|
||||
|
||||
class Mrsk::Configuration
|
||||
delegate :service, :image, :servers, :env, :registry, :ssh_user, to: :config, allow_nil: true
|
||||
delegate :service, :image, :servers, :env, :registry, to: :config, allow_nil: true
|
||||
|
||||
class << self
|
||||
def load_file(file)
|
||||
@@ -78,8 +78,12 @@ class Mrsk::Configuration
|
||||
self.class.argumentize "-e", config.env if config.env.present?
|
||||
end
|
||||
|
||||
def ssh_user
|
||||
config.ssh_user || "root"
|
||||
end
|
||||
|
||||
def ssh_options
|
||||
{ user: config.ssh_user || "root", auth_methods: [ "publickey" ] }
|
||||
{ user: ssh_user, auth_methods: [ "publickey" ] }
|
||||
end
|
||||
|
||||
def master_key
|
||||
|
||||
Reference in New Issue
Block a user