startup.bash 1017 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. set -e
  2. # cd /root/temp/svn/Publish/DevOps/release-bash;bash startup.bash;
  3. #---------------------------------------------------------------------
  4. #(x.1)参数
  5. args_="
  6. export APPNAME=xxxxxx
  7. export DOCKER_USERNAME=serset
  8. export DOCKER_PASSWORD=xxx
  9. export NUGET_SERVER=https://api.nuget.org/v3/index.json
  10. export NUGET_KEY=xxxxxxxxxx
  11. # "
  12. #----------------------------------------------
  13. #(x.2)当前路径
  14. curPath=$PWD
  15. cd $curPath/../../..
  16. export basePath=$PWD
  17. cd $curPath
  18. # export basePath=/root/temp/svn
  19. #----------------------------------------------
  20. echo "(x.3)get appVersion"
  21. export appVersion=`grep '<Version>' $(find ${basePath} -name *.csproj -exec grep '<pack>\|<publish>' -l {} \; | head -n 1) | grep -oE '\>(.*)\<' | tr -d '<>/'`
  22. echo appVersion: $appVersion
  23. #----------------------------------------------
  24. #(x.4)bash
  25. for file in *.sh
  26. do
  27. echo "\n\n\n\n\n-----------------------------------------------------------------"
  28. echo "[$(date "+%H:%M:%S")] sh $file"
  29. sh $file
  30. done