forked from GoAdminGroup/go-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
94 lines (80 loc) · 2.45 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
85
86
87
88
89
90
91
92
93
94
TEST_CONFIG_PATH=./../common/config.json
TEST_CONFIG_PQ_PATH=./../common/config_pg.json
ASSETS_PATH=$(ASSETS_PATH)
all: run
assets:
find ./ -name ".DS_Store" -depth -exec rm {} \;
rm -rf $(ASSETS_PATH)/dist
mkdir $(ASSETS_PATH)/dist
mkdir $(ASSETS_PATH)/dist/js
mkdir $(ASSETS_PATH)/dist/css
cp $(ASSETS_PATH)/src/js/*.js $(ASSETS_PATH)/dist/js/
cp $(ASSETS_PATH)/src/css/*.png $(ASSETS_PATH)/dist/css/
cp -R $(ASSETS_PATH)/src/css/fonts $(ASSETS_PATH)/dist/css/
cp -R $(ASSETS_PATH)/src/img $(ASSETS_PATH)/dist/
cp -R $(ASSETS_PATH)/src/fonts $(ASSETS_PATH)/dist/
make combine
admincli compile asset
make tmpl
make fmt
combine:
find ./ -name ".DS_Store" -depth -exec rm {} \;
make combine-js
make combine-css
combine-js:
admincli combine js
admincli combine js --path=$(ASSETS_PATH)/src/js/combine2/ --out=$(ASSETS_PATH)/dist/js/all_2.min.js
admincli combine js --path=$(ASSETS_PATH)/src/js/combine3/ --out=$(ASSETS_PATH)/dist/js/form.min.js
combine-css:
admincli combine css
tmpl:
admincli compile tpl
fmt:
go fmt ./adapter/...
go fmt ./admincli/...
go fmt ./context/...
go fmt ./engine/...
go fmt ./examples/...
go fmt ./modules/...
go fmt ./plugins/...
go fmt ./template/...
deps:
go get github.com/kardianos/govendor
govendor sync
test:
make mysql-test
make pg-test
mysql-test:
make import-mysql
gotest -v ./tests/gin/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/beego/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/buffalo/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/chi/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/echo/... -args $(TEST_CONFIG_PATH)
make import-mysql
gotest -v ./tests/gorilla/... -args $(TEST_CONFIG_PATH)
import-mysql:
mysql -uroot -proot go-admin-test < ./data/admin.sql
import-postgresql:
dropdb -U postgres go-admin-test
createdb -U postgres go-admin-test
psql -d go-admin-test -U postgres -f ./data/admin.pgsql
pg-test:
make import-postgresql
gotest -v ./tests/gin/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/beego/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/buffalo/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/chi/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/echo/... -args $(TEST_CONFIG_PQ_PATH)
make import-postgresql
gotest -v ./tests/gorilla/... -args $(TEST_CONFIG_PQ_PATH)
lint:
golangci-lint run