automake_agx_back.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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_exe/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. foldernfs=/mnt/nfs1
  26. echo $foldernfs
  27. foldernfs=$foldernfs/AGXXavier
  28. month=`date +%Y.%m`
  29. foldernfs=$foldernfs/$month
  30. urllink="http://10.16.1.138"
  31. echo $foldernfs
  32. if [ ! -d "$foldernfs" ]; then
  33. CreateFolder $foldernfs
  34. fi
  35. if [ "$GITVERSIONCODE" = "$VERSIONCODE" ]; then
  36. sleep 1s
  37. else
  38. VERSIONCODE=$GITVERSIONCODE
  39. ./autogen.sh
  40. ./autodeploy.sh
  41. cd ../../deploy
  42. zip -r app.zip app
  43. cd ../../modularization_exe
  44. git pull
  45. cd ../modularization/deploy
  46. # cp app.zip ../../modularization_exe/agx
  47. cp app.zip $foldernfs/$GITVERSIONCODE.zip
  48. cd ../../modularization_exe/agx
  49. cat /dev/null > appversion
  50. echo "$VERSIONCODE" >> appversion
  51. compiletime=`date "+%Y.%m.%d %H:%M:%S"`
  52. cat /dev/null > Readme.md
  53. echo " " > Readme.md
  54. sed -i "1 a\ Build Time : $compiletime \n\n" Readme.md
  55. # sed -i "1 a\ Version : $VERSIONCODE \n\n" Readme.md
  56. sed -i "1 a\ 最新版本APP : [下载]($urllink/AGXXavier/$month/$GITVERSIONCODE.zip) \n\n" Readme.md
  57. cd ..
  58. git add -u
  59. git commit -m "automake change app. code version:$VERSIONCODE"
  60. git push
  61. cd ../modularization/sh/automake
  62. fi
  63. sleep 10m
  64. done