1 : 新建代码目录
系统目录
cd /auto/vue
创建代码存放目录
mkdir code
创建发布包目录
mkdir static
2 : 拉取SVN代码
svn搭建参考链接:https://blog.csdn.net/qq_38254635/article/details/115697947
svn checkout SVN地址 --username=SVN账号 --password=SVN密码 服务器地址
eg:svn checkout svn://localhost/auto/code --username=admin --password=admin /auto/vue/code
3 : 服务器搭建node.js
node搭建参考链接:https://blog.csdn.net/qq_38254635/article/details/115699508
4 : 编写shell脚本文件
创建shell脚本文件
cd /auto/vue
mkdir auto.sh
编辑shell脚本文件
vi auto.sh
shell脚本内容
echo "====================vue program release start===================="
echo "svn update code, package code"
cd /auto/vue/code
svn up
#npm install --unsafe-perm=true --allow-root
npm run build
echo "backup and delete resource files"
rm -rf /auto/vue/static/dist_bak/*
cp -r /auto/vue/static/dist/* /auto/vue/static/dist_bak
rm -rf /auto/vue/static/dist/*
echo "mobile resource package"
cp -r /auto/vue/code/dist/* /auto/vue/static/dist
echo "When you see this line, the project has been released successfully"
echo "====================vue program release end===================="