执行脚本文件
#编译项目
#echo "----------building project...----------"
vue-cli-service build
#echo "----------building success----------"
dist="./dist/*"
#echo "----------source directory:${dist}----------"
product="/usr/local/var/www/shorter"
# url="root@47.110.15.42"
url="root@149.129.63.107"
#echo "----------depoly directory:${url}:${product}----------"
#清空发布目录的文件
#echo "开始清除发布目录文件"
ssh -t ${url} "rm -rf ${product}/*"
#echo "清除发布目录文件完成"
#复制编译好的文件到发布目录
#echo "----------starting depolying...----------"
scp -r dist/* ${url}:${product}
#echo "----------depolying success----------"
自动化脚本命令
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build --mode production",
"build:report": "vue-cli-service build --report",
"depoly": "sh -x ./build_depoly.sh ",
"release": "sh -x ./build_release.sh ",
"lint": "vue-cli-service lint"
},