startup.bash 838 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. set -e
  2. # cd /root/docker-data/dev/jenkins/jenkins_home/workspace/Repo/Sers/code/Publish/DevOps/build-bash;bash startup.bash;
  3. #----------------------------------------------
  4. #(x.1)当前路径
  5. curPath=$PWD
  6. cd $curPath/../../..
  7. export basePath=$PWD
  8. cd $curPath
  9. #----------------------------------------------
  10. echo "(x.2)get version"
  11. export version=`grep '<Version>' $(grep '<pack>\|<publish>' ${basePath} -r --include *.csproj -l | head -n 1) | grep -oP '>(.*)<' | tr -d '<>'`
  12. echo $version
  13. #----------------------------------------------
  14. echo "(x.3)自动发布 $name-$version"
  15. for file in *.sh
  16. do
  17. echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  18. echo "[$(date "+%H:%M:%S")]" bash $file
  19. bash $file
  20. done
  21. #----------------------------------------------
  22. #(x.9)
  23. cd $curPath