sh脚本
# build本地代码
npm run build
read -r -p "确认本地push代码,并且服务器拉取代码? [Y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "Yes"
;;
[nN][oO]|[nN])
echo "No"
# 退出
exit 1
;;
*)
echo "Invalid input..."
# 退出
exit 1
;;
esac
# 继续
git add .
git commit -m "build"
git push
ssh -p user@remoteNode "cd /myProject; git pull"