Browse Source

chore: Update publish script to deploy to a different server

master
sige 1 year ago
parent
commit
7b47bb5729
  1. 10
      publish.ps1

10
publish.ps1

@ -6,15 +6,15 @@ Rename-Item -Path ./dist -NewName $now
# compress dist to app.zip # compress dist to app.zip
Compress-Archive -Path ./$now -DestinationPath ./app.zip -Force Compress-Archive -Path ./$now -DestinationPath ./app.zip -Force
# upload app.zip to server # upload app.zip to server
scp app.zip root@192.168.8.10:/frontend/
scp app.zip root@192.168.8.11:/frontend/
# unzip app.zip # unzip app.zip
ssh root:zwsd@192.168.8.10 "cd /frontend && unzip app.zip"
ssh root:zwsd@192.168.8.11 "cd /frontend && unzip app.zip"
# remove old link # remove old link
ssh root:zwsd@192.168.8.10 "cd /frontend && rm -f dist"
ssh root:zwsd@192.168.8.11 "cd /frontend && rm -f dist"
# create link # create link
ssh root:zwsd@192.168.8.10 "cd /frontend && ln -s /frontend/$now /frontend/dist"
ssh root:zwsd@192.168.8.11 "cd /frontend && ln -s /frontend/$now /frontend/dist"
# remove app.zip # remove app.zip
ssh root:zwsd@192.168.8.10 "cd /frontend && rm -f app.zip"
ssh root:zwsd@192.168.8.11 "cd /frontend && rm -f app.zip"
Remove-Item -Path ./app.zip Remove-Item -Path ./app.zip
# remove folder # remove folder
Remove-Item -Path ./$now -Recurse Remove-Item -Path ./$now -Recurse
Loading…
Cancel
Save