.drone.yml 2.5 KB

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