-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMakefile
53 lines (44 loc) · 1.47 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
.PHONY: local attach before clean down server test up pushdev
local:
docker build -f Dockerfile.alpine -t pgautoupgrade/pgautoupgrade:local .
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:local
clean:
docker image rm --force \
pgautoupgrade/pgautoupgrade:dev \
pgautoupgrade/pgautoupgrade:local
docker image prune -f
docker volume prune -f
down:
docker container stop pgauto
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:local
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:local
pushdev:
docker tag pgautoupgrade/pgautoupgrade:local pgautoupgrade/pgautoupgrade:dev
docker push pgautoupgrade/pgautoupgrade:dev
docker image rm pgautoupgrade/pgautoupgrade:dev