Skip to content

Commit

Permalink
feat: tag Docker image with multiple tags
Browse files Browse the repository at this point in the history
  • Loading branch information
escalate committed Jan 24, 2018
1 parent 2dab1d4 commit b6900a7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
REPO_PREFIX = escalate4u/ha-bridge
TAG = latest
DEVICE_NAME = raspberrypi3
IMAGE_NAME = $(REPO_PREFIX)-$(DEVICE_NAME)
VERSION_NUM = $(shell curl --silent --fail --location --header "Accept: application/json" https://api.github.com/repos/bwssytems/ha-bridge/releases/latest | jq -r '.tag_name')

.PHONY: build
build:
docker build \
--tag=$(REPO_PREFIX)-raspberrypi3:$(TAG) \
--build-arg DEVICE_NAME=raspberrypi3 \
--build-arg HA_BRIDGE_VERSION=5.1.0 \
--tag=$(IMAGE_NAME):build \
--build-arg=DEVICE_NAME=$(DEVICE_NAME) \
--build-arg=HA_BRIDGE_VERSION=5.1.0 \
.

.PHONY: publish
publish: build
docker push $(REPO_PREFIX)-raspberrypi3:$(TAG)
docker tag $(IMAGE_NAME):build $(IMAGE_NAME):$(VERSION_NUM)
docker tag $(IMAGE_NAME):build $(IMAGE_NAME):latest
docker push $(IMAGE_NAME):$(VERSION_NUM)
docker push $(IMAGE_NAME):latest

0 comments on commit b6900a7

Please sign in to comment.