. ../../gradle.properties

developer="sikang"


cus_crop_id=$1
if((${#cus_crop_id}==0))
then
    cus_crop_id="${corp_id_majia}"

if((${#cus_crop_id}==0))
then
    cus_crop_id=="${corp_id}"
fi

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${cus_crop_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 "${cus_crop_id}" "${level}" "${developer}" "${app_id}" "${action}"

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

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

else
    echo "找不到编号"
fi


