执行脚本文件

  1. #编译项目
  2. #echo "----------building project...----------"
  3. vue-cli-service build
  4. #echo "----------building success----------"
  5. dist="./dist/*"
  6. #echo "----------source directory:${dist}----------"
  7. product="/usr/local/var/www/shorter"
  8. # url="root@47.110.15.42"
  9. url="root@149.129.63.107"
  10. #echo "----------depoly directory:${url}:${product}----------"
  11. #清空发布目录的文件
  12. #echo "开始清除发布目录文件"
  13. ssh -t ${url} "rm -rf ${product}/*"
  14. #echo "清除发布目录文件完成"
  15. #复制编译好的文件到发布目录
  16. #echo "----------starting depolying...----------"
  17. scp -r dist/* ${url}:${product}
  18. #echo "----------depolying success----------"

自动化脚本命令

  1. "scripts": {
  2. "serve": "vue-cli-service serve",
  3. "build": "vue-cli-service build --mode production",
  4. "build:report": "vue-cli-service build --report",
  5. "depoly": "sh -x ./build_depoly.sh ",
  6. "release": "sh -x ./build_release.sh ",
  7. "lint": "vue-cli-service lint"
  8. },