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_exe/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 foldernfs=/mnt/nfs1 echo $foldernfs foldernfs=$foldernfs/AGXXavier month=`date +%Y.%m` foldernfs=$foldernfs/$month urllink="http://10.16.1.138" echo $foldernfs if [ ! -d "$foldernfs" ]; then CreateFolder $foldernfs fi if [ "$GITVERSIONCODE" = "$VERSIONCODE" ]; then sleep 1s else VERSIONCODE=$GITVERSIONCODE ./autogen.sh ./autodeploy.sh cd ../../deploy zip -r app.zip app cd ../../modularization_exe git pull cd ../modularization/deploy # cp app.zip ../../modularization_exe/agx cp app.zip $foldernfs/$GITVERSIONCODE.zip cd ../../modularization_exe/agx 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/AGXXavier/$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