前端项目-react&vue的.sh文件根据git仓库分支自动化打包构建到Jenkins部署

echo “正在安装第三方库”
npm i

#!/bin/bash
d=git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3
echo “当前环境” $d;

echo “开始判断环境并执行响应打包命令”

if [ $d = “deploy-test” ] ; then
echo “deploy-test”
export CI=false
yarn build
elif [ $d = “deploy-gray” ] ; then
echo “deploy-gray”
yarn build:gray
elif [ $d = “deploy-release” ] ; then
echo “deploy-release”
yarn build:prod
else

echo “请检查是否分支错误分支错误 , 当前分支是” $d
fi #ifend

你可能感兴趣的:(笔记,react,vue)