. ../../gradle.properties

developer="sikang"

echo "1、commit + push + push_tag + 自动发包登记 （需要配置分支）"
echo "2、自动记录发包（读取包名）"
echo "3、手动记录发包（手动指定包名）"
echo " "

echo -n "请输入指令编号："
read commod

echo -n "此次上架方案："
read action

chmod a+x gponline.py

if (($commod == '1'))
then
    cd ../../
    git add .
    git commit -m "${app_id} ${version_name}"
    git push origin ${git_branch}
    tagName=t${corp_id}-${app_id}
    git tag -d ${tagName}
    git push origin --delete tag ${tagName}
    git tag -a ${tagName} -m ${tagName}
    git push origin ${tagName}
    cd lib_base/script
    python gponline.py "${corp_id}" "${level}" "${developer}" "${app_id}" "${action}"

elif (($commod == '2'))
then
    python gponline.py "${corp_id}" "${level}" "${developer}" "${app_id}" "${action}"

elif (($commod == '3'))
then
    echo -n "输入要指定的包名："
    read pkgname
    python gponline.py "${corp_id}" "${level}" "${developer}" "${pkgname}" "${action}"

else
    echo "找不到编号"
fi


