-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathdaocloud.yml
60 lines (57 loc) · 1.12 KB
/
daocloud.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
version: 3
image: ubuntu:16.04
stages:
- test
- build
Golang测试:
stage: test
job_type: golang-test
only:
branches:
- .*
tags:
- .*
envs:
- key: MYSQL_INSTANCE_NAME
value: test
- key: MYSQL_USERNAME
value: root
image: golang:latest
name: Golang测试
package: github.com/DaoCloud/golang-mysql-sample
scripts:
- mkdir -p ${GOPATH}/src/${PACKAGE}
- cp -r $PWD/* ${GOPATH}/src/${PACKAGE}
- ""
- go get github.com/axw/gocov/gocov/...
- go install github.com/axw/gocov/gocov
- go get github.com/AlekSi/gocov-xml
- go install github.com/AlekSi/gocov-xml
- ""
- go get -t ${PACKAGE}
- path=$(go list ${PACKAGE} | grep -v vendor)
- go vet ${path}
- gocov test -v ${path} > result
- ""
- cat result | gocov-xml > coverage.xml
- cat result | gocov report
services:
- mysql
安全构建任务:
stage: build
job_type: lite_image_build
only:
branches:
- .*
tags:
- .*
compile:
build_dir: /
cache: true
dockerfile_path: /Dockerfile
extract:
- /go/bin/app
package:
build_dir: /
cache: true
dockerfile_path: /Dockerfile.package