-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (31 loc) · 1.11 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
up:
docker-compose up $(container)
down:
docker-compose down
env:
cp ./frontend/example.env ./frontend/.env
DB_SERVICE:=db
DB_NAME:=engineer-ability-visualizer
db/client:
docker-compose exec $(DB_SERVICE) mysql -uroot -hlocalhost -ppassword $(DB_NAME)
db/init:
docker-compose exec $(DB_SERVICE) \
mysql -u root -h localhost -ppassword \
-e "CREATE DATABASE \`$(DB_NAME)\`"
db/drop:
docker-compose exec $(DB_SERVICE) \
mysql -u root -h localhost -ppassword \
-e "drop database \`$(DB_NAME)\`"
MIGRATION_SERVICE:=migration
FLYWAY_CONF?=-url=jdbc:mysql://$(DB_SERVICE):3306/$(DB_NAME) -user=root -password=password
flyway/info:
docker-compose run --rm $(MIGRATION_SERVICE) $(FLYWAY_CONF) info
flyway/validate:
docker-compose run --rm $(MIGRATION_SERVICE) $(FLYWAY_CONF) validate
flyway/migrate:
docker-compose run --rm $(MIGRATION_SERVICE) $(FLYWAY_CONF) migrate
flyway/repair:
docker-compose run --rm $(MIGRATION_SERVICE) $(FLYWAY_CONF) repair
flyway/baseline:
docker-compose run --rm $(MIGRATION_SERVICE) $(FLYWAY_CONF) baseline
export DATABASE_DATASOURCE:=root:password@tcp($(DB_SERVICE):3306)/$(DB_NAME)