-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
53 lines (47 loc) · 1.79 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/make -f
NAME=jamesbrink/postgres
TEMPLATE=Dockerfile.template
POSGTRES_SCRIPT=docker-assets/usr/local/bin/postgres.sh
SED:=$(shell [[ `command -v gsed` ]] && echo gsed || echo sed)
.PHONY: clean all 10 9.6 9.5 9.4
.DEFAULT_GOAL := 10
all: 10 9.6 9.5 9.4
10:
rm -rf $(@)
mkdir -p $(@)
printf "`cat $(TEMPLATE)`" $(@) $(@) $(@) "2.4" > $(@)/Dockerfile
cp -r docker-assets $(@)
printf "`cat $(POSGTRES_SCRIPT)`" $(@) > $(@)/docker-assets/usr/local/bin/postgres.sh
cp -rp hooks $(@)
docker build -t $(NAME):$(@) --build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` $(@)
docker tag $(NAME):$(@) latest
9.6:
rm -rf $(@)
mkdir -p $(@)
printf "`cat $(TEMPLATE)`" $(@) $(@) $(@) "2.3" > $(@)/Dockerfile
cp -r docker-assets $(@)
printf "`cat $(POSGTRES_SCRIPT)`" $(@) > $(@)/docker-assets/usr/local/bin/postgres.sh
cp -rp hooks $(@)
docker build -t $(NAME):$(@) --build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` $(@)
9.5:
rm -rf $(@)
mkdir -p $(@)
printf "`cat $(TEMPLATE)`" $(@) $(@) $(@) "2.2" > $(@)/Dockerfile
cp -r docker-assets $(@)
printf "`cat $(POSGTRES_SCRIPT)`" $(@) > $(@)/docker-assets/usr/local/bin/postgres.sh
cp -rp hooks $(@)
docker build -t $(NAME):$(@) --build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` $(@)
9.4:
rm -rf $(@)
mkdir -p $(@)
printf "`cat $(TEMPLATE)`" $(@) $(@) $(@) "2.1" > $(@)/Dockerfile
cp -r docker-assets $(@)
printf "`cat $(POSGTRES_SCRIPT)`" $(@) > $(@)/docker-assets/usr/local/bin/postgres.sh
cp -rp hooks $(@)
docker build -t $(NAME):$(@) --build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` $(@)
clean:
rm -rf 10 9.4 9.5 9.6