-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (42 loc) · 1.95 KB
/
Makefile
File metadata and controls
54 lines (42 loc) · 1.95 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
NAME=timescaledb
# Default is to timescaledev to avoid unexpected push to the main repo
# Set ORG to timescale in the caller
ORG=timescaledev
PG_VER=pg15
PG_VER_NUMBER=$(shell echo $(PG_VER) | cut -c3-)
PG_CRON_VERSION=v1.6.0
TS_VERSION=2.13.0
POSTGIS_VERSION=3.4.1
ZOMBODB_VERSION=v3000.2.3
PREV_TS_VERSION=$(shell wget --quiet -O - https://raw.githubusercontent.com/timescale/timescaledb/${TS_VERSION}/version.config | grep update_from_version | sed -e 's!update_from_version = !!')
PREV_TS_IMAGE="timescale/timescaledb:$(PREV_TS_VERSION)-pg$(PG_VER_NUMBER)-bitnami"
PREV_IMAGE=$(shell if docker pull $(PREV_TS_IMAGE) >/dev/null; then echo "$(PREV_TS_IMAGE)"; else echo "bitnami/postgresql:$(PG_VER_NUMBER)"; fi )
# Retrieve the latest Git tag for the current commit
RELEASE_TAG = $(shell git describe --tags --abbrev=0 --exact-match HEAD 2>/dev/null)
WARPSQL_VERSION := $(if $(RELEASE_TAG),$(RELEASE_TAG),dev-$(shell git rev-parse HEAD))
# Pre releases should not be tagged as latest, so PRE_RELEASE is used to track.
PRE_RELEASE=$(shell echo "$(WARPSQL_VERSION)" | grep -Eo "alpha|beta|rc")
TAG_VERSION=$(ORG)/$(NAME):$(WARPSQL_VERSION)-$(PG_VER)-bitnami
TAG_LATEST=$(ORG)/$(NAME):latest-$(PG_VER)-bitnami
TAG=-t $(TAG_VERSION) $(if $(PRE_RELEASE),,-t $(TAG_LATEST))
DOCKER_BUILD_ARGS = --build-arg PG_VERSION=$(PG_VER_NUMBER) \
--build-arg TS_VERSION=$(TS_VERSION) \
--build-arg PREV_IMAGE=$(PREV_IMAGE) \
--build-arg PG_CRON_VERSION=$(PG_CRON_VERSION) \
--build-arg POSTGIS_VERSION=$(POSTGIS_VERSION) \
--build-arg ZOMBODB_VERSION=$(ZOMBODB_VERSION)
default: image
.build_$(WARPSQL_VERSION)_$(PG_VER): Dockerfile
docker build -f ./Dockerfile \
$(DOCKER_BUILD_ARGS) \
$(TAG) ..
touch .build_$(WARPSQL_VERSION)_$(PG_VER)-bitnami
image: .build_$(WARPSQL_VERSION)_$(PG_VER)
push: image
docker push $(TAG_VERSION)
if [ -z "$(PRE_RELEASE)" ]; then \
docker push $(TAG_LATEST); \
fi
clean:
rm -f *~ .build_*
.PHONY: default image push clean