Small Makefile refactor

This commit is contained in:
Héctor Molinero Fernández 2019-05-05 13:18:03 +02:00
parent efb0ae3084
commit 95c17ea279

View File

@ -1,7 +1,7 @@
#!/usr/bin/make -f #!/usr/bin/make -f


SHELL := /bin/sh SHELL := /bin/sh
.SHELLFLAGS = -eu -c .SHELLFLAGS := -eu -c


DOCKER := $(shell command -v docker 2>/dev/null) DOCKER := $(shell command -v docker 2>/dev/null)
GIT := $(shell command -v git 2>/dev/null) GIT := $(shell command -v git 2>/dev/null)
@ -20,9 +20,10 @@ endif
IMAGE_LATEST_TAG := $(IMAGE_NAMESPACE)/$(IMAGE_NAME):latest IMAGE_LATEST_TAG := $(IMAGE_NAMESPACE)/$(IMAGE_NAME):latest
IMAGE_VERSION_TAG := $(IMAGE_NAMESPACE)/$(IMAGE_NAME):$(IMAGE_VERSION) IMAGE_VERSION_TAG := $(IMAGE_NAMESPACE)/$(IMAGE_NAME):$(IMAGE_VERSION)


IMAGE_DOCKERFILE := ./Dockerfile
IMAGE_TARBALL := $(DISTDIR)/$(IMAGE_NAME).tgz IMAGE_TARBALL := $(DISTDIR)/$(IMAGE_NAME).tgz


DOCKERFILE := ./Dockerfile

################################################## ##################################################
## "all" target ## "all" target
################################################## ##################################################
@ -37,9 +38,9 @@ all: save-image
.PHONY: build-image .PHONY: build-image
build-image: build-image:
'$(DOCKER)' build \ '$(DOCKER)' build \
--tag '$(IMAGE_LATEST_TAG)' \
--tag '$(IMAGE_VERSION_TAG)' \ --tag '$(IMAGE_VERSION_TAG)' \
--file '$(IMAGE_DOCKERFILE)' ./ --tag '$(IMAGE_LATEST_TAG)' \
--file '$(DOCKERFILE)' ./


################################################## ##################################################
## "save-*" targets ## "save-*" targets