forked from go-reform/reform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone-local.yml
113 lines (102 loc) · 3.75 KB
/
.drone-local.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
workspace:
base: /drone
path: src/gopkg.in/reform.v1
pipeline:
# use volume to download dependencies, share them between steps to reduce build time
download_deps:
image: ${GO}
pull: true
environment:
- GOPATH=/go:/drone
- PATH=/go/bin:/drone/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
volumes:
- drone_cache:/go/src
commands:
- make download_deps
when:
matrix:
DOWNLOAD_DEPS: 1
build:
image: ${GO}
pull: true
environment:
- GOPATH=/go:/drone
- PATH=/go/bin:/drone/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- TZ=Europe/Moscow
volumes:
- drone_cache:/go/src:ro
commands:
- echo ${GO} ${DATABASE} ${VERSION} ${REFORM_DRIVER}
- go version
- make install_deps
- make test
- make test-db
- make check
services:
postgres:
image: postgres:${VERSION}
pull: true
environment:
- TZ=Europe/Moscow
when:
matrix:
DATABASE: postgres
mysql:
image: mysql:${VERSION}
pull: true
environment:
- TZ=Europe/Moscow
- MYSQL_ALLOW_EMPTY_PASSWORD=1
when:
matrix:
DATABASE: mysql
mssql:
image: microsoft/mssql-server-linux:${VERSION}
pull: true
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=reform-password123
when:
matrix:
DATABASE: mssql
matrix:
include:
- {
GO: "golang:1.8", DATABASE: postgres, VERSION: 9.6, REFORM_DRIVER: postgres,
REFORM_ROOT_SOURCE: "postgres://postgres@127.0.0.1/template1?sslmode=disable",
REFORM_INIT_SOURCE: "postgres://postgres@127.0.0.1/reform-database?sslmode=disable&TimeZone=UTC",
REFORM_TEST_SOURCE: "postgres://postgres@127.0.0.1/reform-database?sslmode=disable&TimeZone=America/New_York",
DOWNLOAD_DEPS: 1
}
# ANSI mode
- {
GO: "golang:1.8", DATABASE: mysql, VERSION: 5.7, REFORM_DRIVER: mysql,
REFORM_ROOT_SOURCE: "root@/mysql",
REFORM_INIT_SOURCE: "root@/reform-database?parseTime=true&time_zone='UTC'&sql_mode='ANSI'&multiStatements=true",
REFORM_TEST_SOURCE: "root@/reform-database?parseTime=true&time_zone='America%2FNew_York'&sql_mode='ANSI'"
}
# TRADITIONAL mode + interpolateParams=true
- {
GO: "golang:1.8", DATABASE: mysql, VERSION: 5.7, REFORM_DRIVER: mysql,
REFORM_ROOT_SOURCE: "root@/mysql",
REFORM_INIT_SOURCE: "root@/reform-database?parseTime=true&time_zone='UTC'&sql_mode='ANSI'&multiStatements=true",
REFORM_TEST_SOURCE: "root@/reform-database?parseTime=true&time_zone='America%2FNew_York'&sql_mode='TRADITIONAL'&interpolateParams=true"
}
- {
GO: "golang:1.8", DATABASE: sqlite3, VERSION: dummy, REFORM_DRIVER: sqlite3,
REFORM_ROOT_SOURCE: "/tmp/reform-database.sqlite3",
REFORM_INIT_SOURCE: "/tmp/reform-database.sqlite3",
REFORM_TEST_SOURCE: "/tmp/reform-database.sqlite3"
}
- {
GO: "golang:1.8", DATABASE: mssql, VERSION: latest, REFORM_DRIVER: mssql,
REFORM_ROOT_SOURCE: "server=localhost;user id=sa;password=reform-password123",
REFORM_INIT_SOURCE: "server=localhost;user id=sa;password=reform-password123;database=reform-database",
REFORM_TEST_SOURCE: "server=localhost;user id=sa;password=reform-password123;database=reform-database"
}
- {
GO: "golang:1.8", DATABASE: mssql, VERSION: latest, REFORM_DRIVER: sqlserver,
REFORM_ROOT_SOURCE: "sqlserver://sa:reform-password123@localhost",
REFORM_INIT_SOURCE: "sqlserver://sa:reform-password123@localhost?database=reform-database",
REFORM_TEST_SOURCE: "sqlserver://sa:reform-password123@localhost?database=reform-database"
}