70.docker-image-create.sh 899 B

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