.drone.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. kind: pipeline
  2. name: default
  3. steps:
  4. - name: restore-cache
  5. image: rpi.it5000.com:5000/drillster/drone-volume-cache
  6. settings:
  7. restore: true
  8. mount:
  9. - ./repository
  10. volumes:
  11. - name: cache
  12. path: /cache
  13. - name: mvn-package
  14. image: rpi.it5000.com:5000/jaikuai/npm-mvn:rpi
  15. commands:
  16. - mvn clean package -Dmaven.test.skip=true -Dmaven.repo.local=./repository -s ./setting.xml
  17. - name: rebuild-cache
  18. image: rpi.it5000.com:5000/drillster/drone-volume-cache
  19. settings:
  20. rebuild: true
  21. mount:
  22. - ./repository
  23. volumes:
  24. - name: cache
  25. path: /cache
  26. - name: docker-build
  27. image: rpi.it5000.com:5000/docker:27
  28. privileged: true
  29. volumes:
  30. - name: docker
  31. path: /var/run/docker.sock
  32. commands:
  33. - docker build -t registry.dev.fast-fun.cn:82/zk/zhili-station-server:2.0.${DRONE_BUILD_NUMBER} -f Dockerfile .
  34. - docker push registry.dev.fast-fun.cn:82/zk/zhili-station-server:2.0.${DRONE_BUILD_NUMBER}
  35. when:
  36. branch:
  37. - prd
  38. - dev
  39. - name: deploy
  40. image: rpi.it5000.com:5000/appleboy/drone-ssh
  41. settings:
  42. host: 192.168.0.175
  43. username: root
  44. password: qx123456
  45. script:
  46. - docker rm -f station-server
  47. - docker run -d -p 8888:8888 -p 9987:9987 -e PRO_ENV=test --name station-server --restart=always registry.dev.fast-fun.cn:82/zk/zhili-station-server:2.0.${DRONE_BUILD_NUMBER}
  48. volumes:
  49. - name: cache
  50. host:
  51. path: /home/drone/cache
  52. - name: docker
  53. host:
  54. path: /var/run/docker.sock