.drone-back.yml 2.6 KB

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