Allow running detached app commands
this is useful for long running rake tasks or scripts that can be run without having to keep open connection to the server. Example: ``` kamal app exec 'bin/rails db:backfill_task' --detach ```
This commit is contained in:
@@ -234,6 +234,12 @@ class CommandsAppTest < ActiveSupport::TestCase
|
||||
new_command.execute_in_new_container("bin/rails", "db:setup", env: { "foo" => "bar" }).join(" ")
|
||||
end
|
||||
|
||||
test "execute in new detached container" do
|
||||
assert_equal \
|
||||
"docker run --detach --rm --network kamal --env-file .kamal/apps/app/env/roles/web.env dhh/app:999 bin/rails db:setup",
|
||||
new_command.execute_in_new_container("bin/rails", "db:setup", detach: true, env: {}).join(" ")
|
||||
end
|
||||
|
||||
test "execute in new container with tags" do
|
||||
@config[:servers] = [ { "1.1.1.1" => "tag1" } ]
|
||||
@config[:env]["tags"] = { "tag1" => { "ENV1" => "value1" } }
|
||||
|
||||
Reference in New Issue
Block a user