.drone.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. - ./node_modules
  13. - name: build
  14. image: node:12-alpine
  15. commands:
  16. - npm install -g cnpm --registry=https://registry.npm.taobao.org
  17. - cnpm install
  18. - cnpm install core-js
  19. - cnpm run build:prod
  20. - name: rebuild-cache
  21. image: drillster/drone-volume-cache
  22. volumes:
  23. - name: cache
  24. path: /cache
  25. settings:
  26. rebuild: true
  27. mount:
  28. - ./node_modules
  29. - name: docker
  30. image: plugins/docker
  31. settings:
  32. tags:
  33. - latest
  34. - 1.0.${DRONE_BUILD_NUMBER}
  35. registry: nas.fast-fun.cn:5000
  36. insecure: true
  37. repo: nas.fast-fun.cn:5000/zhl/pdms-oss-ui
  38. - name: deploy
  39. image: appleboy/drone-ssh
  40. settings:
  41. host: 192.168.0.41
  42. username: zhl
  43. password: 123456
  44. script:
  45. - docker rm -f oss-ui
  46. - docker rmi -f nas.fast-fun.cn:5000/zhl/pdms-oss-ui
  47. - docker run -d --name oss-api --link pdms-oss-api:pdms-oss-api -l traefik.port=80 nas.fast-fun.cn:5000/zhl/pdms-oss-ui
  48. volumes:
  49. - name: cache
  50. host:
  51. path: /home/drone/cache