Compare commits
1 Commits
rollback-s
...
fix-per-ro
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb2a9b5f72 |
@@ -93,7 +93,7 @@ class Kamal::Cli::Main < Kamal::Cli::Base
|
|||||||
mutating do
|
mutating do
|
||||||
invoke_options = deploy_options
|
invoke_options = deploy_options
|
||||||
|
|
||||||
KAMAL.config.version = Kamal::Git.used? ? Kamal::Git.resolve_revision(version) : version
|
KAMAL.config.version = version
|
||||||
old_version = nil
|
old_version = nil
|
||||||
|
|
||||||
if container_available?(version)
|
if container_available?(version)
|
||||||
|
|||||||
@@ -13,16 +13,6 @@ module Kamal::Git
|
|||||||
`git rev-parse HEAD`.strip
|
`git rev-parse HEAD`.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
# Attempt to convert a short -> long git sha, or return the original
|
|
||||||
def resolve_revision(revision)
|
|
||||||
resolved_rev = `git rev-parse -q --verify #{revision}`.strip
|
|
||||||
if resolved_rev.empty?
|
|
||||||
revision
|
|
||||||
else
|
|
||||||
resolved_rev
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def uncommitted_changes
|
def uncommitted_changes
|
||||||
`git status --porcelain`.strip
|
`git status --porcelain`.strip
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -46,6 +46,14 @@ class CommandsHealthcheckTest < ActiveSupport::TestCase
|
|||||||
new_command.run.join(" ")
|
new_command.run.join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "run with custom per-role healthcheck options" do
|
||||||
|
@config[:servers] = { "web" => { "hosts" => [ "1.1.1.1" ],
|
||||||
|
"healthcheck" => { "log_lines" => 150 } } }
|
||||||
|
assert_equal \
|
||||||
|
"docker container ls --all --filter name=^healthcheck-app-123$ --quiet | xargs docker logs --tail 150 2>&1",
|
||||||
|
new_command.logs.join(" ")
|
||||||
|
end
|
||||||
|
|
||||||
test "status" do
|
test "status" do
|
||||||
assert_equal \
|
assert_equal \
|
||||||
"docker container ls --all --filter name=^healthcheck-app-123$ --quiet | xargs docker inspect --format '{{if .State.Health}}{{.State.Health.Status}}{{else}}{{.State.Status}}{{end}}'",
|
"docker container ls --all --filter name=^healthcheck-app-123$ --quiet | xargs docker inspect --format '{{if .State.Health}}{{.State.Health.Status}}{{else}}{{.State.Status}}{{end}}'",
|
||||||
|
|||||||
Reference in New Issue
Block a user