.drone.yml 1.6 KB

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