-
Notifications
You must be signed in to change notification settings - Fork 2
/
.drone.yml
88 lines (79 loc) · 2.23 KB
/
.drone.yml
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
workspace:
base: /root/go-projects/
path: src/git.ultraware.nl/NiseVoid/qb
pipeline:
setup:
image: registry.ultraware.nl/ultraware/go-build:latest
pull: true
commands:
- make setup
- mv /go/src vendor/
test:
image: registry.ultraware.nl/ultraware/go-build:latest
pull: true
commands:
- make test
- make lint
- go test -bench=.
PostgreSQL:
image: registry.ultraware.nl/ultraware/go-build:latest
pull: true
environment:
- POSTGRES_TESTHOST=pgsql
commands:
- make test_postgres
MSSQL:
image: registry.ultraware.nl/ultraware/go-build:latest
pull: true
environment:
- MSSQL_TESTHOST=sqlserver
commands:
- make test_mssql
MySQL:
image: registry.ultraware.nl/ultraware/go-build:latest
pull: true
environment:
- MYSQL_TESTHOST=mariadb
commands:
- make test_mysql
total_coverage:
image: registry.ultraware.nl/ultraware/go-build:latest
pull: true
commands:
- cat unit.out > total.out
- tail -n +2 postgres.out >> total.out
- tail -n +2 mysql.out >> total.out
- tail -n +2 mssql.out >> total.out
- go tool cover -func total.out | tail -1
services:
pgsql:
image: postgres:10.1-alpine
pull: true
environment:
- DB_HOST=postgres
- POSTGRES_USER=qb_test
- POSTGRES_DB=qb_test
mariadb:
image: mariadb:10.3
pull: true
environment:
- MYSQL_DATABASE=qb_test
- MYSQL_USER=qb_test
- MYSQL_PASSWORD=qb_test
- MYSQL_ALLOW_EMPTY_PASSWORD=true
sqlserver:
image: microsoft/mssql-server-linux:latest
pull: true
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=P@ssw0rd
commands:
- echo "CREATE DATABASE qb_test;" > setup.sql
- echo "GO" >> setup.sql
- echo "USE qb_test;" >> setup.sql
- echo "GO" >> setup.sql
- echo "CREATE LOGIN qb_test WITH PASSWORD = 'qb_testA1';" >> setup.sql
- echo "CREATE USER qb_test FOR LOGIN qb_test;" >> setup.sql
- echo "EXEC sp_addrolemember 'db_owner', 'qb_test'" >> setup.sql
- (sleep 1s; /opt/mssql-tools/bin/sqlcmd -b -S localhost -U SA -P $MSSQL_SA_PASSWORD -i setup.sql) &
- /opt/mssql/bin/sqlservr --accept-eula