Allow exec to run in its own container

This commit is contained in:
David Heinemeier Hansson
2023-01-15 13:51:08 +01:00
parent 89161b66a1
commit 8e58a9385a
3 changed files with 22 additions and 3 deletions

View File

@@ -40,6 +40,16 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
*command
end
def run_exec(*command)
docker :run,
"-it",
"--rm",
*rails_master_key_arg,
*config.env_args,
config.absolute_image,
*command
end
def console(host: config.primary_host)
"ssh -t #{config.ssh_user}@#{host} '#{exec("bin/rails", "c", interactive: true).join(" ")}'"
end