推送脚本:添加检查git和env

This commit is contained in:
luying
2022-08-09 14:33:07 +08:00
parent 0daa7ff626
commit 5f2d2d6722

View File

@@ -43,9 +43,46 @@ else
exit 1;
fi
node ./config.js ${env}
echo "|*********************|\n"
if branch=$(git symbolic-ref --short -q HEAD)
then
echo "git on branch $branch \n"
else
echo "git not on any branch \n"
fi
echo "|*********************|\n"
echo "and config.json is: \n"
node ./config.js ${env}
cat './game-server/config.json'
echo "\n"
echo "|*********************|\n"
echo "and server_const is \n"
cat './shared/resource/jsons/server_const.json' | grep DEBUG_PAY
cat './shared/resource/jsons/server_const.json' | grep DEBUG_TIME
cat './shared/resource/jsons/server_const.json' | grep CHECK_WORD
cat './shared/resource/jsons/server_const.json' | grep CAN_PAY
cat './shared/resource/jsons/server_const.json' | grep SKIP_ENCODE
echo "\n"
echo "|*********************|"
read -r -p "Are You Sure? [Y/n]" input
case $input in
[yY][eE][sS]|[yY])
echo "Yes"
rsync -av --include '.babelrc' --include '.eslintrc.js' --exclude-from='exclude-file.txt' --progress --inplace --no-owner --no-group --rsh='ssh -p'${port} . ${destUrl}
;;
[nN][oO]|[nN])
echo "No"
;;
*)
echo "Invalid input"
;;
esac
rsync -av --include '.babelrc' --include '.eslintrc.js' --exclude-from='exclude-file.txt' --progress --inplace --no-owner --no-group --rsh='ssh -p'${port} . ${destUrl}
git checkout ./game-server/config.json
git checkout ./gm-server/config/env
git checkout ./web-server/config/env
git checkout ./web-server/config/env