automake_agx.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. folder=$(echo $PWD) ;
  2. filepath=$folder/../../.git/refs/heads/master;
  3. function CreateFolder()
  4. {
  5. folderdir=$1
  6. mkdir $folderdir
  7. # cd $folderdir
  8. # cp ../../template/index.html ./
  9. # cd ..
  10. }
  11. while true
  12. do
  13. cd ../../
  14. git pull
  15. cd ./sh/automake
  16. VERSIONCODE=$(cat $folder/../../../modularization_pro/agx/appversion)
  17. echo "app version: "$VERSIONCODE
  18. GITVERSIONCODE="unknown"
  19. if [ -f "$filepath" ]; then
  20. gitversion=$(cat $folder/../../.git/refs/heads/master)
  21. # echo $gitversion
  22. GITVERSIONCODE=$gitversion
  23. fi
  24. echo "code version: "$GITVERSIONCODE
  25. month=`date +%Y.%m`
  26. urllink="http://10.15.0.89:3000/adc_pilot/modularization_pro/src/master/agx"
  27. if [ "$GITVERSIONCODE" = "$VERSIONCODE" ]; then
  28. sleep 1s
  29. else
  30. VERSIONCODE=$GITVERSIONCODE
  31. ./autogen.sh
  32. cd ../../
  33. zip -r pilotbin.zip pilotbin
  34. cd ../modularization_pro
  35. git pull
  36. cd agx
  37. mkdir $month
  38. cd ../../modularization
  39. cp pilotbin.zip ../modularization_pro/agx/$month/$GITVERSIONCODE.zip
  40. cd ../modularization_pro/agx
  41. git add $month
  42. cat /dev/null > appversion
  43. echo "$VERSIONCODE" >> appversion
  44. compiletime=`date "+%Y.%m.%d %H:%M:%S"`
  45. cat /dev/null > Readme.md
  46. echo " " > Readme.md
  47. sed -i "1 a\ Build Time : $compiletime \n\n" Readme.md
  48. # sed -i "1 a\ Version : $VERSIONCODE \n\n" Readme.md
  49. sed -i "1 a\ 最新版本APP : [下载]($urllink/$month/$GITVERSIONCODE.zip) \n\n" Readme.md
  50. cd ..
  51. git add -u
  52. git commit -m "automake change app. code version:$VERSIONCODE"
  53. git push
  54. cd ../modularization/sh/automake
  55. fi
  56. sleep 10m
  57. done