.drone.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. kind: pipeline
  2. name: default
  3. trigger:
  4. branch:
  5. - dashboard-screen
  6. steps:
  7. - name: build
  8. image: node:14
  9. commands:
  10. - npm config set registry http://registry.npm.taobao.org
  11. - npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/
  12. - npm config set electron_mirror https://npm.taobao.org/mirrors/electron/
  13. - npm i
  14. - npm run build:stage
  15. - pwd
  16. - ls -la
  17. - name: removeFiles
  18. image: appleboy/drone-ssh
  19. settings:
  20. host: gdsc.ninecase.top
  21. username: root
  22. password: $jgkj001
  23. debug: true
  24. script:
  25. - cd /www/wwwroot/railway-web.iamsee.com/release
  26. - pwd
  27. - chattr -i dist/.user.ini
  28. # - rm -rf dist
  29. - rm -rf Dockerfile
  30. - name: scp_files
  31. image: appleboy/drone-scp
  32. settings:
  33. host: 172.17.0.1
  34. username: root
  35. password: $jgkj001
  36. debug: true
  37. target:
  38. - /www/wwwroot/railway-web.iamsee.com/release
  39. - /www/wwwroot/railway-web.iamsee.com/release
  40. - /www/wwwroot/railway-web.iamsee.com/release
  41. source:
  42. - dist
  43. - nginx-conf
  44. - Dockerfile
  45. rm: true
  46. script:
  47. - ls -hl
  48. - name: deploy-build-image
  49. image: appleboy/drone-ssh
  50. settings:
  51. host: gdsc.ninecase.top
  52. username: root
  53. password: $jgkj001
  54. debug: true
  55. script:
  56. - cp -r /www/wwwroot/railway-web.iamsee.com/工区DXF /www/wwwroot/railway-web.iamsee.com/release/dist/static/
  57. - cp -r /www/wwwroot/railway-web.iamsee.com/工区所亭DXF /www/wwwroot/railway-web.iamsee.com/release/dist/static/
  58. - cd /www/wwwroot/railway-web.iamsee.com/release
  59. - docker build -t iamsee/railway-web:1.0.0 .
  60. - docker save -o railway-web@1.0.0.tar iamsee/railway-web:1.0.0
  61. volumes:
  62. - name: cache # The name use in this pipeline,
  63. host:
  64. path: /tmp/cache # The path be used in the host.
  65. - name: dockersock
  66. host:
  67. path: /var/run/docker.sock