1.新建一个自由风格的项目
2.配置git
3.构建-增加构建步骤-执行shell
cd $WORKSPACE npm install --registry=http://ip:port --unsafe-perm npm run build:prod current=`date "+%Y%m%d%H%M%S"` rm -rf auditcenter*.zip cd dist zip -r auditcenter.zip auditcenter mv auditcenter.zip ../auditcenter.zip cp -r auditcenter ‘/tmp/auditcenter‘$current rm -rf auditcenter cd .. if [ ! -f "auditcenter.zip" ];then echo "auditcenter.zip不存在" else mv auditcenter.zip ‘auditcenter‘${current}‘.zip‘ fi
4.构建项目即可,可在工作区查看拉取的前端包
原文:https://www.cnblogs.com/wang-mengmeng/p/11338703.html