-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (29 loc) · 1.06 KB
/
Makefile
File metadata and controls
41 lines (29 loc) · 1.06 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
VERSIONS = jessie stretch buster trusty xenial bionic
TEST_TIMEOUT_SECONDS = 120
GOSS_PATH = .tmp/goss
DGOSS_PATH = .tmp/dgoss
default: build
dockerfiles: $(addsuffix /Dockerfile,$(VERSIONS))
%/Dockerfile: Dockerfile.template
@mkdir -p $* && sed "s/%%VERSION%%/$*/" Dockerfile.template > $*/Dockerfile
@test -e $*/patch.sh && bash $*/patch.sh
build: $(addprefix build-,$(VERSIONS))
build-%: %/Dockerfile
docker build -t dpirotte/postgres-dev:$* $*
test-%: test_deps
@env \
GOSS_PATH=${GOSS_PATH} \
GOSS_VARS="goss_vars.yaml" \
GOSS_OPTS="--max-concurrent 1 --color" \
${DGOSS_PATH} run dpirotte/postgres-dev:$* sleep ${TEST_TIMEOUT_SECONDS}
test: $(addprefix test-,$(VERSIONS))
.PHONY: test_deps
test_deps: ${GOSS_PATH} ${DGOSS_PATH}
${GOSS_PATH}:
@mkdir -p .tmp
@curl -fsSL https://github.com/aelsabbahy/goss/releases/download/v0.3.6/goss-linux-amd64 -o ${GOSS_PATH}
@chmod +rx ${GOSS_PATH}
${DGOSS_PATH}:
@mkdir -p .tmp
@curl -fsSL https://raw.githubusercontent.com/aelsabbahy/goss/v0.3.6/extras/dgoss/dgoss -o ${DGOSS_PATH}
@chmod +rx ${DGOSS_PATH}