folder=$(echo $PWD) ; filepath=$folder/../../.git/refs/heads/master; function CreateFolder() { folderdir=$1 mkdir $folderdir # cd $folderdir # cp ../../template/index.html ./ # cd .. } while true do cd ../../ git pull cd ./sh/automake VERSIONCODE=$(cat $folder/../../../modularization_pro/agx/appversion) echo "app version: "$VERSIONCODE GITVERSIONCODE="unknown" if [ -f "$filepath" ]; then gitversion=$(cat $folder/../../.git/refs/heads/master) # echo $gitversion GITVERSIONCODE=$gitversion fi echo "code version: "$GITVERSIONCODE month=`date +%Y.%m` urllink="http://10.15.0.89:3000/adc_pilot/modularization_pro/src/master/agx" if [ "$GITVERSIONCODE" = "$VERSIONCODE" ]; then sleep 1s else VERSIONCODE=$GITVERSIONCODE ./autogen.sh cd ../../ zip -r pilotbin.zip pilotbin cd ../modularization_pro git pull cd agx mkdir $month cd ../../modularization cp pilotbin.zip ../modularization_pro/agx/$month/$GITVERSIONCODE.zip cd ../modularization_pro/agx git add $month cat /dev/null > appversion echo "$VERSIONCODE" >> appversion compiletime=`date "+%Y.%m.%d %H:%M:%S"` cat /dev/null > Readme.md echo " " > Readme.md sed -i "1 a\ Build Time : $compiletime \n\n" Readme.md # sed -i "1 a\ Version : $VERSIONCODE \n\n" Readme.md sed -i "1 a\ 最新版本APP : [下载]($urllink/$month/$GITVERSIONCODE.zip) \n\n" Readme.md cd .. git add -u git commit -m "automake change app. code version:$VERSIONCODE" git push cd ../modularization/sh/automake fi sleep 10m done