.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. APP_ENVIRONMENT: test
  9. GO_WORK_DIR: /bin/kptTmrGroup
  10. steps:
  11. - name: clone
  12. image: alpine/git
  13. commands:
  14. - git clone -b develop http://kpt.kptyun.cn:3000/xuyiping/kpt-tmr-group.git
  15. - name: test
  16. image: golang:1.17
  17. commands:
  18. - cd /drone/src/kpt-tmr-group
  19. - go test `go list ./... | grep -v -E "mock|store|test|fake|cmd|bin|backend|google|logger|proto"` -coverprofile .cover.txt
  20. - go tool cover -func .cover.txt
  21. - rm .cover.txt
  22. - name: build
  23. image: plugins/docker
  24. volumes:
  25. - name: hosts
  26. path: /etc/hosts
  27. - name: docker-ca
  28. path: /etc/docker
  29. - name: dockersock
  30. path: /var/run/docker.sock
  31. settings:
  32. dockerfile: /drone/src/kpt-tmr-group/Dockerfile
  33. username:
  34. from_secret: aliyuncs_username
  35. password:
  36. from_secret: aliyuncs_password
  37. repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/kpt-tmr-group
  38. registry: registry.cn-hangzhou.aliyuncs.com
  39. tags: [1.0.0,latest]
  40. trigger:
  41. branch:
  42. include:
  43. - develop
  44. event:
  45. - push
  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