.drone.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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: 172.16.0.28
  21. username: root
  22. password: $Jgkj1234
  23. debug: true
  24. script:
  25. - cd /www/wwwroot/railway-web.ninecase.top/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.16.0.28
  34. username: root
  35. password: $Jgkj1234
  36. debug: true
  37. target:
  38. - /www/wwwroot/railway-web.ninecase.top/release
  39. - /www/wwwroot/railway-web.ninecase.top/release
  40. - /www/wwwroot/railway-web.ninecase.top/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: $Jgkj1234
  54. debug: true
  55. script:
  56. - cp -r /www/wwwroot/railway-web.ninecase.top/工区DXF /www/wwwroot/railway-web.ninecase.top/release/dist/static/
  57. - cp -r /www/wwwroot/railway-web.ninecase.top/工区所亭DXF /www/wwwroot/railway-web.ninecase.top/release/dist/static/
  58. - cd /www/wwwroot/railway-web.ninecase.top/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