50.docker-image-copy.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. set -e
  2. #---------------------------------------------------------------------
  3. # args
  4. args_="
  5. export basePath=/root/temp/svn
  6. # "
  7. #---------------------------------------------------------------------
  8. #1 copy docker image from ReleaseFile
  9. publishPath="$basePath/Publish/release/release/Station(net6.0)"
  10. dockerPath=$basePath/Publish/release/release/docker-image
  11. if [ -d "$basePath/Publish/ReleaseFile/docker-image" ]; then
  12. echo "50.docker-image-copy.sh -> #1 copy docker image from ReleaseFile"
  13. \cp -rf "$basePath/Publish/ReleaseFile/docker-image/." "$dockerPath"
  14. fi
  15. #---------------------------------------------------------------------
  16. echo "50.docker-image-copy.sh -> #2 copy station"
  17. for file in $(find $basePath -name *.csproj -exec grep '<docker>' -l {} \;)
  18. do
  19. cd $basePath
  20. publishName=`grep '<publish>' $file -r | grep -oE '\>(.*)\<' | tr -d '<>/'`
  21. dockerName=`grep '<docker>' $file -r | grep -oE '\>(.*)\<' | tr -d '<>/'`
  22. echo "#2.* copy $dockerName, publishName:$publishName"
  23. \cp -rf "$publishPath/$publishName/." "$dockerPath/$dockerName/app"
  24. done