mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-25 11:44:44 +00:00
pkg: Consolidate $(TAG) to be the full tag
Saves lots of repetitions of `$(ORG)/$(IMAGE):$(HASH)$(DIRTY)` throughout the file. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This commit is contained in:
parent
4a3d5acb88
commit
66f9cc134f
@ -6,7 +6,7 @@ HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
|
|||||||
BASE_DEPS=Dockerfile Makefile
|
BASE_DEPS=Dockerfile Makefile
|
||||||
|
|
||||||
DIRTY=$(shell git diff-index --quiet HEAD -- ../$(notdir $(CURDIR)) || echo "-dirty")
|
DIRTY=$(shell git diff-index --quiet HEAD -- ../$(notdir $(CURDIR)) || echo "-dirty")
|
||||||
TAG=$(HASH)$(DIRTY)
|
TAG=$(ORG)/$(IMAGE):$(HASH)$(DIRTY)
|
||||||
|
|
||||||
# Get a release tag, if present
|
# Get a release tag, if present
|
||||||
RELEASE=$(shell git tag -l --points-at HEAD)
|
RELEASE=$(shell git tag -l --points-at HEAD)
|
||||||
@ -18,19 +18,19 @@ NET_OPT=--network=none
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
show-tag:
|
show-tag:
|
||||||
@echo $(ORG)/$(IMAGE):$(TAG)
|
@echo $(TAG)
|
||||||
|
|
||||||
tag: $(BASE_DEPS) $(DEPS)
|
tag: $(BASE_DEPS) $(DEPS)
|
||||||
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(TAG) || \
|
DOCKER_CONTENT_TRUST=1 docker pull $(TAG) || \
|
||||||
docker build $(NET_OPT) -t $(ORG)/$(IMAGE):$(TAG) .
|
docker build $(NET_OPT) -t $(TAG) .
|
||||||
|
|
||||||
push: tag
|
push: tag
|
||||||
ifneq ($(DIRTY),)
|
ifneq ($(DIRTY),)
|
||||||
$(error Your repository is not clean. Will not push package image.)
|
$(error Your repository is not clean. Will not push package image.)
|
||||||
endif
|
endif
|
||||||
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(TAG) || \
|
DOCKER_CONTENT_TRUST=1 docker pull $(TAG) || \
|
||||||
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(TAG)
|
DOCKER_CONTENT_TRUST=1 docker push $(TAG)
|
||||||
ifneq ($(RELEASE),)
|
ifneq ($(RELEASE),)
|
||||||
docker tag $(ORG)/$(IMAGE):$(TAG) $(ORG)/$(IMAGE):$(RELEASE)
|
docker tag $(TAG) $(ORG)/$(IMAGE):$(RELEASE)
|
||||||
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(RELEASE)
|
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(RELEASE)
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user