forked from pgautoupgrade/docker-pgautoupgrade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
84 lines (67 loc) · 2.93 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
83
84
.PHONY: all dev 13dev 14dev 15dev prod attach before clean down server test up pushdev pushprod
all: 12dev 13dev 14dev 15dev 16dev prod
dev: 16dev
12dev:
docker build --build-arg PGTARGET=12 -t pgautoupgrade/pgautoupgrade:12-dev .
13dev:
docker build --build-arg PGTARGET=13 -t pgautoupgrade/pgautoupgrade:13-dev .
14dev:
docker build --build-arg PGTARGET=14 -t pgautoupgrade/pgautoupgrade:14-dev .
15dev:
docker build --build-arg PGTARGET=15 -t pgautoupgrade/pgautoupgrade:15-dev .
16dev:
docker build -t pgautoupgrade/pgautoupgrade:16-dev -t pgautoupgrade/pgautoupgrade:dev .
prod:
docker build --build-arg PGTARGET=15 -t pgautoupgrade/pgautoupgrade:15-alpine3.20 -t pgautoupgrade/pgautoupgrade:15-alpine . && \
docker build -t pgautoupgrade/pgautoupgrade:16-alpine3.20 -t pgautoupgrade/pgautoupgrade:16-alpine -t pgautoupgrade/pgautoupgrade:latest .
attach:
docker exec -it pgauto /bin/bash
before:
if [ ! -d "test/postgres-data" ]; then \
mkdir test/postgres-data; \
fi && \
docker run --name pgauto -it --rm \
--mount type=bind,source=$(abspath $(CURDIR))/test/postgres-data,target=/var/lib/postgresql/data \
-e POSTGRES_PASSWORD=password \
-e PGAUTO_DEVEL=before \
pgautoupgrade/pgautoupgrade:dev
clean:
docker image rm --force pgautoupgrade/pgautoupgrade:dev pgautoupgrade/pgautoupgrade:12-dev pgautoupgrade/pgautoupgrade:13-dev \
pgautoupgrade/pgautoupgrade:14-dev pgautoupgrade/pgautoupgrade:15-dev pgautoupgrade/pgautoupgrade:16-dev \
pgautoupgrade/pgautoupgrade:15-alpine pgautoupgrade/pgautoupgrade:16-alpine \
pgautoupgrade/pgautoupgrade:15-alpine3.20 pgautoupgrade/pgautoupgrade:16-alpine3.20 pgautoupgrade/pgautoupgrade:latest && \
docker image prune -f && \
docker volume prune -f
down:
./test.sh down
server:
if [ ! -d "test/postgres-data" ]; then \
mkdir test/postgres-data; \
fi && \
docker run --name pgauto -it --rm --mount type=bind,source=$(abspath $(CURDIR))/test/postgres-data,target=/var/lib/postgresql/data \
-e POSTGRES_PASSWORD=password \
-e PGAUTO_DEVEL=server \
pgautoupgrade/pgautoupgrade:dev
test:
./test.sh
up:
if [ ! -d "test/postgres-data" ]; then \
mkdir test/postgres-data; \
fi && \
docker run --name pgauto -it --rm \
--mount type=bind,source=$(abspath $(CURDIR))/test/postgres-data,target=/var/lib/postgresql/data \
-e POSTGRES_PASSWORD=password \
pgautoupgrade/pgautoupgrade:dev
pushdev:
docker push pgautoupgrade/pgautoupgrade:12-dev && \
docker push pgautoupgrade/pgautoupgrade:13-dev && \
docker push pgautoupgrade/pgautoupgrade:14-dev && \
docker push pgautoupgrade/pgautoupgrade:15-dev && \
docker push pgautoupgrade/pgautoupgrade:16-dev && \
docker push pgautoupgrade/pgautoupgrade:dev
pushprod:
docker push pgautoupgrade/pgautoupgrade:15-alpine3.20 && \
docker push pgautoupgrade/pgautoupgrade:15-alpine && \
docker push pgautoupgrade/pgautoupgrade:16-alpine3.20 && \
docker push pgautoupgrade/pgautoupgrade:16-alpine && \
docker push pgautoupgrade/pgautoupgrade:latest