.drone.yml 1.3 KB

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