Compare commits
1 Commits
1-9-stable
...
rollback-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b694a0814 |
@@ -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 = version
|
KAMAL.config.version = Kamal::Git.used? ? Kamal::Git.resolve_revision(version) : version
|
||||||
old_version = nil
|
old_version = nil
|
||||||
|
|
||||||
if container_available?(version)
|
if container_available?(version)
|
||||||
|
|||||||
@@ -13,6 +13,16 @@ 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
|
||||||
|
|||||||
Reference in New Issue
Block a user