Merge pull request #102 from moomerman/cmd-options-for-healthcheck
Use custom web options for healthcheck
This commit is contained in:
@@ -12,6 +12,7 @@ class Mrsk::Commands::Healthcheck < Mrsk::Commands::Base
|
|||||||
"-e", "MRSK_CONTAINER_NAME=\"#{container_name}\"",
|
"-e", "MRSK_CONTAINER_NAME=\"#{container_name}\"",
|
||||||
*web.env_args,
|
*web.env_args,
|
||||||
*config.volume_args,
|
*config.volume_args,
|
||||||
|
*web.option_args,
|
||||||
config.absolute_image,
|
config.absolute_image,
|
||||||
web.cmd
|
web.cmd
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ class CommandsHealthcheckTest < ActiveSupport::TestCase
|
|||||||
new_command.run.join(" ")
|
new_command.run.join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "run with custom options" do
|
||||||
|
@config[:servers] = { "web" => { "hosts" => [ "1.1.1.1" ], "options" => { "mount" => "somewhere" } } }
|
||||||
|
assert_equal \
|
||||||
|
"docker run --detach --name healthcheck-app-123 --publish 3999:3000 --label service=healthcheck-app --mount \"somewhere\" dhh/app:123",
|
||||||
|
new_command.run.join(" ")
|
||||||
|
end
|
||||||
|
|
||||||
test "curl" do
|
test "curl" do
|
||||||
assert_equal \
|
assert_equal \
|
||||||
"curl --silent --output /dev/null --write-out '%{http_code}' --max-time 2 http://localhost:3999/up",
|
"curl --silent --output /dev/null --write-out '%{http_code}' --max-time 2 http://localhost:3999/up",
|
||||||
|
|||||||
Reference in New Issue
Block a user