-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (36 loc) · 1.36 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
VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2> /dev/null || echo "1.0.0")
APP_DSN := mysql://root:bolo@tcp(127.0.0.1:3306)/invap
MIGRATE := docker run -v $(shell pwd)/migrations:/migrations --network host migrate/migrate:v4.10.0 -path=/migrations/ -database "$(APP_DSN)"
PID_FILE := './.pid'
FSWATCH_FILE := './fswatch.cfg'
.PHONY: default
default: help
.PHONY: clean
clean: ## remove temporary files
rm -rf server coverage.out coverage-all.out
.PHONY: version
version: ## display the version of the API server
@echo $(VERSION)
.PHONY: db-start
db-start: ## start the database server
@mkdir -p testdata/mysql
@docker run --rm --name mariadb -v $(shell pwd)/testdata:/testdata \
-v erpnext_mariadb:/var/lib/mysql \
-v $(shell pwd)/mariadb:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=admin -e MYSQL_DATABASE=ihram -d -p 3306:3306 mariadb:10.6
.PHONY: db-stop
db-stop: ## stop the database server
@docker stop mariadb
.PHONY: redis-start
redis-start: ## start the database server
@mkdir -p redis
@docker run --rm --name redis -v $(shell pwd)/redis:/data -d -p 6379:6379 redis
.PHONY: redis-stop
redis-stop: ## stop the database server
@docker stop redis
.PHONY: erpnext-start
erpnext-start: ## start the php builtin server
@docker compose -p ihram up -d
.PHONY: erpnext-stop
erpnext-stop: ## stop the php builtin server
@docker compose -p ihram down