|
@@ -6,19 +6,45 @@ clone:
|
|
|
depth: 1
|
|
|
disable: true
|
|
|
|
|
|
-
|
|
|
steps:
|
|
|
- name: clone
|
|
|
image: alpine/git
|
|
|
commands:
|
|
|
- - pwd
|
|
|
- - ls -l
|
|
|
+ - git clone -b develop http://kpt.kptyun.cn:3000/xuyiping/kpt-tmr-group.git
|
|
|
+ - name: test
|
|
|
+ image: golang:1.17
|
|
|
+ commands:
|
|
|
+ - cd /drone/src/kpt-tmr-group
|
|
|
+ - go env -w GO111MODULE=on
|
|
|
+ - go env -w GOPROXY=https://goproxy.cn,direct
|
|
|
+ - go env -w CGO_ENABLED=0
|
|
|
+ - go mod tidy -compat=1.17
|
|
|
+ - go test `go list ./... | grep -v -E "mock|store|test|fake|cmd|bin|backend|google|logger|proto"` -coverprofile .cover.txt
|
|
|
+ - go tool cover -func .cover.txt
|
|
|
+ - rm .cover.txt
|
|
|
+ - name: build
|
|
|
+ image: plugins/docker
|
|
|
+ volumes:
|
|
|
+ - name: hosts
|
|
|
+ path: /etc/hosts
|
|
|
+ - name: docker-ca
|
|
|
+ path: /etc/docker
|
|
|
+ - name: dockersock
|
|
|
+ path: /var/run/docker.sock
|
|
|
+ settings:
|
|
|
+ dockerfile: /drone/src/kpt-tmr-group/Dockerfile
|
|
|
+ username:
|
|
|
+ from_secret: aliyuncs_username
|
|
|
+ password:
|
|
|
+ from_secret: aliyuncs_password
|
|
|
+ repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/kpt-tmr-group
|
|
|
+ registry: registry.cn-hangzhou.aliyuncs.com
|
|
|
+ tags: [ 1.0.7,latest ]
|
|
|
trigger:
|
|
|
branch:
|
|
|
include:
|
|
|
- develop
|
|
|
event:
|
|
|
- - push
|
|
|
- merge
|
|
|
|
|
|
volumes:
|