大空间消毒机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
714 B

  1. # build project
  2. yarn build
  3. # rename dist to current time, like 20221215121300
  4. $now = Get-Date -Format "yyyyMMddHHmmss"
  5. Rename-Item -Path ./dist -NewName $now
  6. # compress dist to app.zip
  7. Compress-Archive -Path ./$now -DestinationPath ./app.zip -Force
  8. # upload app.zip to server
  9. scp app.zip root@192.168.8.10:/frontend/
  10. # unzip app.zip
  11. ssh root:zwsd@192.168.8.10 "cd /frontend && unzip app.zip"
  12. # remove old link
  13. ssh root:zwsd@192.168.8.10 "cd /frontend && rm -f dist"
  14. # create link
  15. ssh root:zwsd@192.168.8.10 "cd /frontend && ln -s /frontend/$now /frontend/dist"
  16. # remove app.zip
  17. ssh root:zwsd@192.168.8.10 "cd /frontend && rm -f app.zip"
  18. Remove-Item -Path ./app.zip
  19. # remove folder
  20. Remove-Item -Path ./$now -Recurse