30.nuget-pack.sh 873 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. mkdir -p $basePath/Publish/release/release
  12. #----------------------------------------------
  13. echo "30.nuget-pack.sh"
  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. mkdir -p /root/code/$nugetPath
  25. cd /root/code
  26. cd \$(dirname \"\$file\")
  27. dotnet build --configuration Release
  28. dotnet pack --configuration Release --output '/root/code/$nugetPath'
  29. done
  30. "