30.nuget-pack.sh 746 B

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