.drone.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. kind: pipeline
  2. type: docker
  3. name: kptTmrGroup
  4. clone:
  5. depth: 1
  6. disable: true
  7. steps:
  8. - name: clone
  9. image: alpine/git
  10. commands:
  11. - git clone -b develop http://kpt.kptyun.cn:3000/xuyiping/kpt-tmr-group.git
  12. - name: test
  13. image: golang:1.17
  14. commands:
  15. - cd /drone/src/kpt-tmr-group
  16. - go env -w GO111MODULE=on
  17. - go env -w GOPROXY=https://goproxy.cn,direct
  18. - go env -w CGO_ENABLED=0
  19. - go mod tidy -compat=1.17
  20. - go test `go list ./... | grep -v -E "mock|store|test|fake|cmd|bin|backend|google|logger|proto"` -coverprofile .cover.txt
  21. - go tool cover -func .cover.txt
  22. - rm .cover.txt
  23. - name: build
  24. image: plugins/docker
  25. volumes:
  26. - name: hosts
  27. path: /etc/hosts
  28. - name: docker-ca
  29. path: /etc/docker
  30. - name: dockersock
  31. path: /var/run/docker.sock
  32. settings:
  33. dockerfile: /drone/src/kpt-tmr-group/Dockerfile
  34. username:
  35. from_secret: aliyuncs_username
  36. password:
  37. from_secret: aliyuncs_password
  38. repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/kpt-tmr-group
  39. registry: registry.cn-hangzhou.aliyuncs.com
  40. tags: [ 1.0.7,latest ]
  41. trigger:
  42. branch:
  43. include:
  44. - develop
  45. event:
  46. - merge
  47. volumes:
  48. - name: docker-ca
  49. host:
  50. path: /etc/docker
  51. - name: dockersock
  52. host:
  53. path: /var/run/docker.sock