50.docker-image-create.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. set -e
  2. #---------------------------------------------------------------------
  3. #(x.1)参数
  4. args_="
  5. export basePath=/root/temp/svn
  6. # "
  7. #---------------------------------------------------------------------
  8. #(x.2)
  9. publishPath="$basePath/Publish/release/release/Station(net5.0)"
  10. dockerPath=$basePath/Publish/release/release/docker-image
  11. #---------------------------------------------------------------------
  12. echo "(x.3)copy dir"
  13. \cp -rf "$basePath/Publish/ReleaseFile/docker-image/." "$dockerPath"
  14. #---------------------------------------------------------------------
  15. echo "(x.4)copy station"
  16. #查找所有需要发布的项目并copy
  17. cd $basePath
  18. for file in $(grep -a '<docker>' . -rl --include *.csproj)
  19. do
  20. cd $basePath
  21. #get publishName
  22. publishName=`grep '<publish>' $file -r | grep -oP '>(.*)<' | tr -d '<>'`
  23. #get dockerName
  24. dockerName=`grep '<docker>' $file -r | grep -oP '>(.*)<' | tr -d '<>'`
  25. echo copy $dockerName
  26. \cp -rf "$publishPath/$publishName/." "$dockerPath/$dockerName/app"
  27. done
  28. #copy单体压测
  29. \cp -rf "$basePath/Publish/release/release/StressTest/单体压测net5.0/ServiceCenter/." "$dockerPath/sers-demo-sersall/app"