.drone.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. kind: pipeline
  2. type: docker
  3. name: tmp-group-admin
  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://192.168.1.8:3000/duanxiaoduan/tmr-group-admin.git
  12. - cp -R tmr-group-admin/* ./
  13. - name: build
  14. image: plugins/docker
  15. volumes:
  16. - name: hosts
  17. path: /etc/hosts
  18. - name: docker-ca
  19. path: /etc/docker
  20. - name: docker-sock
  21. path: /var/run/docker.sock
  22. settings:
  23. dockerfile: /drone/src/Dockerfile
  24. username:
  25. from_secret: aliyun_name
  26. password:
  27. from_secret: aliyun_password
  28. repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/tmr-group-admin
  29. registry: registry.cn-hangzhou.aliyuncs.com
  30. tags: [ test ]
  31. - name: ssh commands
  32. image: appleboy/drone-ssh
  33. settings:
  34. host: 192.168.1.70
  35. username: tmrwatch
  36. password:
  37. from_secret: ssh_password
  38. port: 22
  39. script:
  40. - cd /data/docker-compose/tmr-group-admin/
  41. - echo "123456" | ./restart.sh
  42. trigger:
  43. branch:
  44. include:
  45. - feature/*
  46. event:
  47. include:
  48. - push
  49. volumes:
  50. - name: host
  51. host:
  52. path: /etc/host
  53. - name: docker-ca
  54. host:
  55. path: /ect/docker
  56. - name: docker-sock
  57. host:
  58. path: /var/run/docker.sock
  59. ---
  60. kind: pipeline
  61. type: docker
  62. name: product
  63. steps:
  64. - name: build
  65. image: plugins/docker:20.14.2
  66. volumes:
  67. - name: hosts
  68. path: /etc/hosts
  69. - name: docker-ca
  70. path: /etc/docker
  71. - name: docker-sock
  72. path: /var/run/docker.sock
  73. settings:
  74. username:
  75. from_secret: aliyun_name
  76. password:
  77. from_secret: aliyun_password
  78. repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/tmr-group-admin
  79. registry: registry.cn-hangzhou.aliyuncs.com
  80. tag:
  81. - latest
  82. - ${DRONE_BRANCH##release/}
  83. trigger:
  84. branch:
  85. include:
  86. - release/*
  87. event:
  88. include:
  89. - push
  90. volumes:
  91. - name: docker-ca
  92. host:
  93. path: /etc/docker
  94. - name: docker-sock
  95. host:
  96. path: /var/run/docker.sock
  97. ---
  98. kind: pipeline
  99. type: docker
  100. name: fix
  101. steps:
  102. - name: build
  103. image: plugins/docker:20.14.2
  104. volumes:
  105. - name: hosts
  106. path: /etc/hosts
  107. - name: docker-ca
  108. path: /etc/docker
  109. - name: docker-sock
  110. path: /var/run/docker.sock
  111. settings:
  112. username:
  113. from_secret: aliyun_name
  114. password:
  115. from_secret: aliyun_password
  116. repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/tmr-group-admin
  117. registry: registry.cn-hangzhou.aliyuncs.com
  118. tag:
  119. - latest
  120. trigger:
  121. branch:
  122. include:
  123. - fix/*
  124. event:
  125. include:
  126. - push
  127. volumes:
  128. - name: docker-ca
  129. host:
  130. path: /etc/docker
  131. - name: docker-sock
  132. host:
  133. path: /var/run/docker.sock