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

@@ -15,4 +15,10 @@ class AppCommandTest < ActiveSupport::TestCase
assert_equal \
[:docker, :run, "-d", "--restart unless-stopped", "--name", "app-123", "-e", "RAILS_MASTER_KEY=456", "--label", "service=app", "--label", "role=web", "--label", "traefik.http.routers.app.rule='PathPrefix(`/`)'", "--label", "traefik.http.services.app.loadbalancer.healthcheck.path=/up", "--label", "traefik.http.services.app.loadbalancer.healthcheck.interval=1s", "--label", "traefik.http.middlewares.app.retry.attempts=3", "--label", "traefik.http.middlewares.app.retry.initialinterval=500ms", "dhh/app:123"], @app.run
end
test "run with" do
assert_equal \
[ :docker, :run, "-it", "--rm", "-e", "RAILS_MASTER_KEY=456", "dhh/app:123", "bin/rails", "db:setup" ],
@app.run_exec("bin/rails", "db:setup")
end
end