-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (71 loc) · 2.23 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/make -f
NAME=utensils/nginx
TEMPLATE=Dockerfile.template
SHELL=/usr/bin/env bash
.DEFAULT_GOAL := 1.17.1
.PHONY: all
all: 1.17.1 1.16.0 1.15.8
.PHONY: 1.17.1
1.17.1:
mkdir -p $(@)
cp -rp runtime-assets $(@)
cp -rp build-assets $(@)
cp -rp hooks $(@)
cp Dockerfile.template $(@)/Dockerfile
cp .dockerignore $(@)/.dockerignore
sed -i -r 's/ARG NGINX_VERSION.*/ARG NGINX_VERSION="$(@)"/g' $(@)/Dockerfile
cd $(@) && docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
-t $(NAME):$(@) .
docker tag $(NAME):$(@) $(NAME):latest
.PHONY: 1.16.0
1.16.0:
mkdir -p $(@)
cp -rp runtime-assets $(@)
cp -rp build-assets $(@)
cp -rp hooks $(@)
cp Dockerfile.template $(@)/Dockerfile
cp .dockerignore $(@)/.dockerignore
sed -i -r 's/ARG NGINX_VERSION.*/ARG NGINX_VERSION="$(@)"/g' $(@)/Dockerfile
cd $(@) && docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
-t $(NAME):$(@) .
docker tag $(NAME):$(@) $(NAME):stable
.PHONY: 1.15.8
1.15.8:
mkdir -p $(@)
cp -rp runtime-assets $(@)
cp -rp build-assets $(@)
cp -rp hooks $(@)
cp Dockerfile.template $(@)/Dockerfile
cp .dockerignore $(@)/.dockerignore
sed -i -r 's/ARG NGINX_VERSION.*/ARG NGINX_VERSION="$(@)"/g' $(@)/Dockerfile
cd $(@) && docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
-t $(NAME):$(@) .
.PHONY: test
test: test-1.17.1 test-1.16.0 test-1.15.8
.PHONY: test-1.17.1
test-1.17.1:
docker run -t utensils/nginx:1.17.1 nginx -V | grep "nginx/1.17.1"
docker run utensils/nginx:1.17.1 nginx -t
.PHONY: test-1.16.0
test-1.16.0:
docker run -t utensils/nginx:1.16.0 nginx -V | grep "nginx/1.16.0"
docker run utensils/nginx:1.16.0 nginx -t
.PHONY: test.15.8
test-1.15.8:
docker run -t utensils/nginx:1.15.8 nginx -V | grep "nginx/1.15.8"
docker run utensils/nginx:1.15.8 nginx -t
.PHONY: push
push:
docker push $(NAME):1.17.1
docker push $(NAME):1.16.0
docker push $(NAME):1.15.8
docker push $(NAME):latest
docker push $(NAME):stable
.PHONY: clean
clean:
rm -rf 1.17.1
rm -rf 1.16.0
rm -rf 1.15.8