Skip to content

Commit

Permalink
test(ci): upgrade drone ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cg33 committed Jun 1, 2021
1 parent d89838f commit 7595a74
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
kind: pipeline
name: mysql_test
name: mssql_test

clone:
disable: true

services:
- name: db_mysql
image: mysql:5.7
- name: db_mssql
image: mcr.microsoft.com/mssql/server:2017-latest
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: go-admin-test
ACCEPT_EULA: Y
SA_PASSWORD: Aa123456

steps:
- name: api_test
Expand All @@ -23,7 +23,7 @@ steps:
- git checkout -- go.mod go.sum
- git checkout $DRONE_COMMIT
- sleep 80
- make mysql-test
- make ms-test

---
kind: pipeline
Expand Down Expand Up @@ -75,17 +75,17 @@ steps:

---
kind: pipeline
name: mssql_test
name: mysql_test

clone:
disable: true

services:
- name: db_mssql
image: mcr.microsoft.com/mssql/server:2017-latest
- name: db_mysql
image: mysql:5.7
environment:
ACCEPT_EULA: Y
SA_PASSWORD: Aa123456
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: go-admin-test

steps:
- name: api_test
Expand All @@ -98,4 +98,4 @@ steps:
- git checkout -- go.mod go.sum
- git checkout $DRONE_COMMIT
- sleep 80
- make ms-test
- make mysql-test
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ import-postgresql:
PGPASSWORD=${POSTGRESSQL_PWD} psql -h ${POSTGRESSQL_HOST} -p ${POSTGRESSQL_PORT} -d ${TEST_DB} -U ${POSTGRESSQL_USER} -f ./tests/data/admin_pg.sql

import-mssql:
sqlcmd -S db_mssql -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/go/src/github.com/GoAdminGroup/go-admin/tests/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5"
/opt/mssql-tools/bin/sqlcmd -S db_mssql -U SA -P Aa123456 -Q "RESTORE DATABASE [goadmin] FROM DISK = N'/go/src/github.com/GoAdminGroup/go-admin/tests/data/admin_ms.bak' WITH FILE = 1, NOUNLOAD, REPLACE, RECOVERY, STATS = 5"

backup-mssql:
docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Aa123456 -Q "BACKUP DATABASE [goadmin] TO DISK = N'/home/data/admin_ms.bak' WITH NOFORMAT, NOINIT, NAME = 'goadmin-full', SKIP, NOREWIND, NOUNLOAD, STATS = 10"
Expand Down

0 comments on commit 7595a74

Please sign in to comment.