mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 10:09:07 +00:00
pkg: Allow override of commit to calculate hash for show-tag
Useful to answer the question of what the hash was at the point of some older commit. $ make --no-print-directory -C pkg/init/ show-tag linuxkit/init:36c56f0664d49c5a6adc1120d1bf5ba6ac30b389 $ make --no-print-directory -C pkg/init/ show-tag HASH_COMMIT=4699f80ef73141ee87a77d03f93065e541fab382 linuxkit/init:17693d233dd009b2a3a8d23673cb85969e1dce80 Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This commit is contained in:
parent
a315e0b681
commit
bdd7e7163b
@ -2,10 +2,13 @@
|
|||||||
default: push
|
default: push
|
||||||
|
|
||||||
ORG?=linuxkit
|
ORG?=linuxkit
|
||||||
HASH?=$(shell git ls-tree --full-tree HEAD -- $(CURDIR) | awk '{print $$3}')
|
HASH_COMMIT?=HEAD # Setting this is only really useful with the show-tag target
|
||||||
|
HASH?=$(shell git ls-tree --full-tree $(HASH_COMMIT) -- $(CURDIR) | awk '{print $$3}')
|
||||||
BASE_DEPS=Dockerfile Makefile
|
BASE_DEPS=Dockerfile Makefile
|
||||||
|
|
||||||
|
ifneq ($(HASH_COMMIT),HEAD) # Others can't be dirty by definition
|
||||||
DIRTY=$(shell git diff-index --quiet HEAD -- $(CURDIR) || echo "-dirty")
|
DIRTY=$(shell git diff-index --quiet HEAD -- $(CURDIR) || echo "-dirty")
|
||||||
|
endif
|
||||||
TAG=$(ORG)/$(IMAGE):$(HASH)$(DIRTY)
|
TAG=$(ORG)/$(IMAGE):$(HASH)$(DIRTY)
|
||||||
|
|
||||||
# Get a release tag, if present
|
# Get a release tag, if present
|
||||||
|
Loading…
Reference in New Issue
Block a user