30.nuget-pack.sh 852 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. set -e
  2. # bash 30.nuget-pack.sh
  3. #---------------------------------------------------------------------
  4. #(x.1)参数
  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. mkdir -p $basePath/Publish/release/release/nuget
  11. nugetPath=Publish/release/release/nuget
  12. #----------------------------------------------
  13. echo "(x.2)nuget-pack"
  14. docker run -i --rm \
  15. --env LANG=C.UTF-8 \
  16. -v $NUGET_PATH:/root/.nuget \
  17. -v $basePath:/root/code \
  18. serset/dotnet:sdk-6.0 \
  19. bash -c "
  20. cd /root/code
  21. for file in \$(grep -a '<pack>nuget</pack>' . -rl --include *.csproj)
  22. do
  23. echo pack \$file
  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. "