Skip to content

Commit 673334d

Browse files
committed
Better makefile
1 parent 676eef3 commit 673334d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
DB_DIR=$(shell pwd)/_db
2-
v=5.7
3-
MYSQL_VERSION=$(v)
1+
V=5.7
2+
DB_DIR=$(shell pwd)/_db-$(V)
43

54
start_db:
6-
@echo Starting MySQL $(MYSQL_VERSION)
5+
@echo Starting MySQL $(V)
76
docker run --rm -d --name spatial-mysql \
87
-p 3306:3306 \
98
-v $(DB_DIR):/var/lib/mysql \
109
-e MYSQL_DATABASE=spatial_test \
1110
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
12-
mysql:$(MYSQL_VERSION) --character-set-server=utf8 --collation-server=utf8_general_ci
13-
docker logs -f spatial-mysql
11+
mysql:$(V) --character-set-server=utf8 --collation-server=utf8_general_ci
1412

15-
purge_db:
16-
docker stop spatial-mysql
13+
rm_db:
14+
docker stop spatial-mysql || true
1715
rm -Rf $(DB_DIR)
1816

17+
refresh_db: rm_db start_db
18+
1919
get_ip:
2020
@docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' spatial-mysql

0 commit comments

Comments
 (0)