.drone.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. kind: pipeline
  2. type: docker
  3. name: test
  4. #clone:
  5. # depth: 1
  6. # disable: true
  7. steps:
  8. #- name: clone
  9. # image: alpine/git
  10. # commands:
  11. # - git config --global credential.helper store
  12. # - git clone -b develop http://192.168.1.8:3000/duanxiaoduan/tmr-admin.git
  13. # - cp -R tmr-admin/* ./
  14. # - ls -l
  15. - name: build
  16. image: plugins/docker
  17. volumes:
  18. - name: hosts
  19. path: /etc/hosts
  20. - name: docker-ca
  21. path: /etc/docker
  22. - name: docker-sock
  23. path: /var/run/docker.sock
  24. settings:
  25. dockerfile: /drone/src/Dockerfile
  26. username:
  27. from_secret: aliyun_name
  28. password:
  29. from_secret: aliyun_password
  30. repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/tmr-admin
  31. registry: registry.cn-hangzhou.aliyuncs.com
  32. tags: [test]
  33. trigger:
  34. branch:
  35. include:
  36. - feature/*
  37. event:
  38. include:
  39. - push
  40. volumes:
  41. - name: host
  42. host:
  43. path: /etc/host
  44. - name: docker-ca
  45. host:
  46. path: /ect/docker
  47. - name: docker-sock
  48. host:
  49. path: /var/run/docker.sock
  50. ---
  51. kind: pipeline
  52. type: docker
  53. name: product
  54. steps:
  55. - name: build
  56. image: plugins/docker:20.14.2
  57. volumes:
  58. - name: hosts
  59. path: /etc/hosts
  60. - name: docker-ca
  61. path: /etc/docker
  62. - name: docker-sock
  63. path: /var/run/docker.sock
  64. settings:
  65. username:
  66. from_secret: aliyun_name
  67. password:
  68. from_secret: aliyun_password
  69. repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/tmr-admin
  70. registry: registry.cn-hangzhou.aliyuncs.com
  71. tag:
  72. - latest
  73. - ${DRONE_BRANCH##release/}
  74. trigger:
  75. branch:
  76. include:
  77. - release/*
  78. event:
  79. include:
  80. - push
  81. volumes:
  82. - name: docker-ca
  83. host:
  84. path: /etc/docker
  85. - name: docker-sock
  86. host:
  87. path: /var/run/docker.sock
  88. ---
  89. kind: pipeline
  90. type: docker
  91. name: hotfix
  92. steps:
  93. - name: build
  94. image: plugins/docker:20.14.2
  95. volumes:
  96. - name: hosts
  97. path: /etc/hosts
  98. - name: docker-ca
  99. path: /etc/docker
  100. - name: docker-sock
  101. path: /var/run/docker.sock
  102. settings:
  103. username:
  104. from_secret: aliyun_name
  105. password:
  106. from_secret: aliyun_password
  107. repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/tmr-admin
  108. registry: registry.cn-hangzhou.aliyuncs.com
  109. tag:
  110. - latest
  111. trigger:
  112. branch:
  113. include:
  114. - hotfix/*
  115. event:
  116. include:
  117. - push
  118. volumes:
  119. - name: docker-ca
  120. host:
  121. path: /etc/docker
  122. - name: docker-sock
  123. host:
  124. path: /var/run/docker.sock