.drone.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. - pwd
  21. - ls -l
  22. - cd /drone/src/kpt-tmr-group
  23. - go test `go list ./... | grep -v -E "mock|store|test|fake|cmd|bin|backend|google|logger|proto"` -coverprofile .cover.txt
  24. - go tool cover -func .cover.txt
  25. - rm .cover.txt
  26. - name: build
  27. image: plugins/docker
  28. volumes:
  29. - name: hosts
  30. path: /etc/hosts
  31. - name: docker-ca
  32. path: /etc/docker
  33. - name: dockersock
  34. path: /var/run/docker.sock
  35. settings:
  36. dockerfile: /drone/src/kpt-tmr-group/Dockerfile
  37. username:
  38. from_secret: aliyuncs_username
  39. password:
  40. from_secret: aliyuncs_password
  41. repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/kpt-tmr-group
  42. registry: registry.cn-hangzhou.aliyuncs.com
  43. tags: [ 1.0.0,latest ]
  44. trigger:
  45. branch:
  46. include:
  47. - develop
  48. event:
  49. include:
  50. - push
  51. volumes:
  52. - name: docker-ca
  53. host:
  54. path: /etc/docker
  55. - name: dockersock
  56. host:
  57. path: /var/run/docker.sock