30.nuget-pack.sh 831 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. set -e
  2. # bash 30.nuget-pack.sh
  3. #---------------------------------------------------------------------
  4. # args
  5. args_="
  6. export basePath=/root/temp/svn
  7. export NUGET_PATH=$basePath/Publish/release/.nuget
  8. # "
  9. if [ ! $NUGET_PATH ]; then NUGET_PATH=$basePath/Publish/release/.nuget; fi
  10. nugetPath=Publish/release/release/nuget
  11. #----------------------------------------------
  12. echo "30.nuget-pack.sh"
  13. docker run -i --rm \
  14. --env LANG=C.UTF-8 \
  15. -v $NUGET_PATH:/root/.nuget \
  16. -v $basePath:/root/code \
  17. serset/dotnet:sdk-6.0 \
  18. bash -c "
  19. cd /root/code
  20. for file in \$(grep -a '<pack>nuget</pack>' . -rl --include *.csproj)
  21. do
  22. echo pack \$file
  23. mkdir -p /root/code/$nugetPath
  24. cd /root/code
  25. cd \$(dirname \"\$file\")
  26. dotnet build --configuration Release
  27. dotnet pack --configuration Release --output '/root/code/$nugetPath'
  28. done
  29. "