Browse Source

Set a tag strategy

pull/145/head
Jérémy DECOOL 2 years ago
parent
commit
161fa0e348
No known key found for this signature in database GPG Key ID: 60D6FF1081E8575
  1. 11
      Makefile

11
Makefile

@ -1,13 +1,22 @@
TAG := $(GITHUB_REF)
ifeq ($(TAG),)
TAG := $(shell git symbolic-ref --short -q HEAD)
endif
ifeq ($(TAG),)
TAG := $(shell git rev-parse --short --verify HEAD)
endif
define docker_build_and_push
docker buildx build \
--push \
--platform linux/arm64,linux/amd64 \
-t "schickling/$1:$(if $2,$2,latest)" \
-t "schickling/$1:$(if $2,$2,$(TAG))" \
./$1
endef
help:
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-18s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
@echo $(TAG)
all: beanstalkd beanstalkd-console hugin jekyll latex mailcatcher mysql-backup-s3 nginx-envtpl nodejs octave opencv postgres-backup-s3 postgres-restore-s3 redis-commander rust s3cmd scala-sbt-docker swagger-ui thumbor-nginx-cors ## Build all images

Loading…
Cancel
Save