Compare commits
1 Commits
v2.5.2
...
rollback-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b694a0814 |
@@ -93,7 +93,7 @@ class Kamal::Cli::Main < Kamal::Cli::Base
|
||||
mutating do
|
||||
invoke_options = deploy_options
|
||||
|
||||
KAMAL.config.version = version
|
||||
KAMAL.config.version = Kamal::Git.used? ? Kamal::Git.resolve_revision(version) : version
|
||||
old_version = nil
|
||||
|
||||
if container_available?(version)
|
||||
|
||||
@@ -13,6 +13,16 @@ module Kamal::Git
|
||||
`git rev-parse HEAD`.strip
|
||||
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
|
||||
`git status --porcelain`.strip
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user