forked from timescale/timescaledb-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (24 loc) · 816 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
NAME=timescaledb
ORG=timescale
PG_VER=pg10
VERSION=$(shell awk '/^ENV TIMESCALEDB_VERSION/ {print $$3}' Dockerfile)
default: image
.build_$(VERSION)_$(PG_VER): Dockerfile
ifeq ($(PG_VER),pg9.6)
docker build --build-arg PG_VERSION=9.6.10 -t $(ORG)/$(NAME):latest-$(PG_VER) .
docker tag $(ORG)/$(NAME):latest-$(PG_VER) $(ORG)/$(NAME):latest
else
docker build --build-arg PG_VERSION=10.5 -t $(ORG)/$(NAME):latest-$(PG_VER) .
endif
docker tag $(ORG)/$(NAME):latest-$(PG_VER) $(ORG)/$(NAME):$(VERSION)-$(PG_VER)
touch .build_$(VERSION)_$(PG_VER)
image: .build_$(VERSION)_$(PG_VER)
push: image
docker push $(ORG)/$(NAME):$(VERSION)-$(PG_VER)
docker push $(ORG)/$(NAME):latest-$(PG_VER)
ifeq ($(PG_VER),pg9.6)
docker push $(ORG)/$(NAME):latest
endif
clean:
rm -f *~ .build_*
.PHONY: default image push clean