-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
26 lines (22 loc) · 856 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
GITHUB_LATEST_VERSION=$(shell curl https://api.github.com/repos/GoMetric/statsd-http-proxy/releases/latest 2>/dev/null | grep tag_name | awk -F'"' '{print $$4}')
default: docker-build
# to publish to docker registry we need to be logged in
docker-login:
ifdef DOCKER_REGISTRY_USERNAME
@echo "h" $(DOCKER_REGISTRY_USERNAME) "h"
else
docker login
endif
# build docker images
docker-build:
@echo "Building docker image version: " $(GITHUB_LATEST_VERSION)
docker build \
--tag gometric/statsd-http-proxy:latest \
--tag gometric/statsd-http-proxy:$(GITHUB_LATEST_VERSION) \
--build-arg VERSION=$(GITHUB_LATEST_VERSION) \
-f ./Dockerfile.alpine .
# publish docker images to hub
docker-publish: docker-login
docker login
docker push gometric/statsd-http-proxy:latest
docker push gometric/statsd-http-proxy:$(GITHUB_LATEST_VERSION)