Skip to content

Commit

Permalink
Merge pull request GoAdminGroup#390 from wisarmy/master
Browse files Browse the repository at this point in the history
refactor(make): Makefile mysql config extract
  • Loading branch information
cg33 authored Feb 21, 2021
2 parents a797af5 + 22c3a89 commit b3d35e9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ TEST_CONFIG_SQLITE_PATH=./../../common/config_sqlite.json
TEST_CONFIG_MS_PATH=./../../common/config_ms.json
TEST_FRAMEWORK_DIR=./tests/frameworks

## database configs
MYSQL_HOST = 127.0.0.1
MYSQL_PORT = 3306
MYSQL_USER = root
MYSQL_PWD = root

all: test

## tests
Expand Down Expand Up @@ -73,8 +79,8 @@ import-sqlite:
cp ./tests/data/admin.db ./tests/common/admin.db

import-mysql:
mysql -uroot -proot -e "create database if not exists \`go-admin-test\`"
mysql -uroot -proot go-admin-test < ./tests/data/admin.sql
mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} -e "create database if not exists \`go-admin-test\`"
mysql -h$(MYSQL_HOST) -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PWD} go-admin-test < ./tests/data/admin.sql

import-postgresql:
dropdb -U postgres go-admin-test
Expand Down Expand Up @@ -148,4 +154,4 @@ cli:
cp ./adm/build/windows/i386/adm_windows_i386_$(VERSION).zip ./adm/build/zip/
cp ./adm/build/mac/adm_darwin_x86_64_$(VERSION).zip ./adm/build/zip/

.PHONY: all fmt golint govet cp-mod restore-mod test black-box-test mysql-test sqlite-test import-sqlite import-mysql import-postgresql pg-test fix-gf lint cilint cli
.PHONY: all fmt golint govet cp-mod restore-mod test black-box-test mysql-test sqlite-test import-sqlite import-mysql import-postgresql pg-test fix-gf lint cilint cli

0 comments on commit b3d35e9

Please sign in to comment.