deploy_to_prod.sh 360 B

1234567891011121314
  1. #!/bin/bash
  2. #先用ssh-copy-id配置免密登录
  3. cp -r dist/ dist-hipo/
  4. tar -zcvf dist-hipo.tar.gz ./dist-hipo
  5. scp dist-hipo.tar.gz root@hipo:/usr/share/nginx/html
  6. rm -rf dist-hipo
  7. rm -f dist-hipo.tar.gz
  8. ssh root@hipo <<EOF
  9. cd /usr/share/nginx/html
  10. mv dist-hipo/ dist-hipo-bak-$(date +%Y-%m-%d-%H:%M:%S)/
  11. tar -zxvf dist-hipo.tar.gz
  12. rm -f dist-hipo.tar.gz
  13. EOF