-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.drone.yml
70 lines (58 loc) · 1.27 KB
/
config.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
kind: pipeline
name: default
workspace:
base: /go
path: src/github.com/stevenkitter/weilu
steps:
- name: init database
image: mariadb
commands:
- sudo apt-get update && sudo apt install -y mysql-client
- sleep 20
- sh ./wait.sh
- sh ./script_mysql_init/init.sh
- name: build go main.go
image: golang
commands:
- go get -v -t -d ./...
- pw=$PWD
- cd $pw/services/wx
- CGO_ENABLED=0 GOOS=linux go build -o app .
- cd $pw/api
- CGO_ENABLED=0 GOOS=linux go build -o app .
- name: server
image: golang
detach: true
environment:
WXAppSecret:
from_secret: WXAppSecret
WX_MYSQL_PASSWORD:
from_secret: WX_MYSQL_PASSWORD
WX_API_SERVER_ADDRESS: "http://server:8100"
WX_SERVER_ADDRESS: server:51001
MYSQL_URL: "mariadb:3306"
WX_MYSQL_USER: "wx"
WX_DATABASE: "wx"
commands:
- go get -v -t -d ./...
- pw=$PWD
- cd $pw/services/wx
- WXAppSecret=$WX_APP_SECRET ./app
- cd $pw/api
- ./app
- name: test
image: golang
commands:
- go get -v -t -d ./...
- sleep 20
- go test -v ./...
# db mariadb
services:
- name: mariadb
image: mariadb
ports:
- 3306
environment:
MYSQL_ROOT_PASSWORD: 123123
MYSQL_ROOT_HOST: '%'
MYSQL_ALLOW_EMPTY_PASSWORD: 'true'