-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
31 lines (24 loc) · 822 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
27
28
29
30
31
VERSION ?= latest
IMAGE_REPO ?= quay.io/jhansen/consul
CONSUL_VERSION ?= 0.5.2
CONSUL_FILENAME ?= consul_${CONSUL_VERSION}_linux_amd64.zip
.PHONY: all prep clean build tag push clean
all: clean prep build tag push
@echo "Done! ${IMAGE_REPO}:${VERSION}"
info:
@echo "VERSION: ${VERSION}"
@echo "IMAGE_REPO: ${IMAGE_REPO}"
@echo "TAG: ${IMAGE_REPO}:${VERSION}"
@echo "CONSUL_VERSION: ${CONSUL_VERSION}"
prep: clean
mkdir -p upstream
curl -L https://releases.hashicorp.com/consul/${CONSUL_VERSION}/${CONSUL_FILENAME} -o upstream/${CONSUL_FILENAME}
unzip -d . upstream/${CONSUL_FILENAME}
clean:
rm -f consul upstream/${CONSUL_FILENAME}
build: clean prep
docker build -t ${IMAGE_REPO} .
tag:
docker tag ${IMAGE_REPO} ${IMAGE_REPO}:${VERSION}
push:
docker push quay.io/jhansen/consul:${VERSION}