.drone.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. kind: pipeline
  2. name: default
  3. steps:
  4. - name: restore-cache
  5. image: drillster/drone-volume-cache
  6. volumes:
  7. - name: cache
  8. path: /cache
  9. settings:
  10. restore: true
  11. mount:
  12. - .m2
  13. - name: build
  14. image: jaikuai/npm-mvn
  15. pull: true
  16. commands:
  17. - mvn clean install -Dmaven.test.skip=true -Dmaven.repo.local=/drone/src/.m2/repository -Dmaven.compile.fork=true package
  18. - name: rebuild-cache
  19. image: drillster/drone-volume-cache
  20. volumes:
  21. - name: cache
  22. path: /cache
  23. settings:
  24. rebuild: true
  25. mount:
  26. - .m2
  27. - name: docker-hz-admin-server
  28. image: plugins/docker
  29. settings:
  30. tags:
  31. - latest
  32. - 1.0.${DRONE_BUILD_NUMBER}
  33. registry: nas.fast-fun.cn:5000
  34. insecure: true
  35. repo: nas.fast-fun.cn:5000/hz/hz-admin-server
  36. - name: deploy-hz-admin
  37. image: appleboy/drone-ssh
  38. settings:
  39. host: 116.62.135.225
  40. username: root
  41. password:
  42. from_secret: password
  43. script:
  44. - docker pull nas.fast-fun.cn:5000/hz/hz-admin-server:1.0.${DRONE_BUILD_NUMBER}
  45. - docker rm -f hz-admin-server
  46. - docker run -d --name hz-admin-server -p 8082:8082 --restart=always nas.fast-fun.cn:5000/hz/hz-admin-server:1.0.${DRONE_BUILD_NUMBER}
  47. volumes:
  48. - name: cache
  49. host:
  50. path: /home/drone/cache