case ${status} in
deploy)
node -v
npm -v
cnpm -v
cd D:/Jenkins_workspace/项目名称
cnpm install
cd D:/Jenkins_workspace/项目名称
cnpm run build
echo "Status:$Status"
path="D:/publish/项目名称/bak/${BUILD_NUMBER}"
mkdir -p $path
\cp -r ${WORKSPACE}/dist/static $path
\cp -f ${WORKSPACE}/dist/index.html $path
echo "Completing!"
;;
roll_back)
echo "status:$status"
echo "version:$version"
cd ${WORKSPACE}
rm -rf dist/static
rm -rf dist/index.html
cd D:/publish/项目名称/bak/$version
\cp -f index.html ${WORKSPACE}/dist/
\cp -r static ${WORKSPACE}/dist/
;;
esac
Windows环境jenkins下vue参数化构建备份回滚以及远程部署
原文:https://www.cnblogs.com/shook/p/12621553.html