ci-source-build.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env bash
  2. #
  3. # This script is meant for testing source build by imitating some of the input parameters and conditions.
  4. #
  5. set -euo pipefail
  6. scriptroot="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  7. reporoot="$(dirname "$(dirname "$scriptroot")")"
  8. #
  9. # This commented out section is used for servicing branches
  10. #
  11. # For local development, make a backup copy of this file first
  12. # if [ ! -f "$reporoot/global.bak.json" ]; then
  13. # mv "$reporoot/global.json" "$reporoot/global.bak.json"
  14. # fi
  15. # Detect the current version of .NET Core installed
  16. # export SDK_VERSION=$(dotnet --version)
  17. # echo "The ambient version of .NET Core SDK version = $SDK_VERSION"
  18. # Update the global.json file to match the current .NET environment
  19. # cat "$reporoot/global.bak.json" | \
  20. # jq '.sdk.version=env.SDK_VERSION' | \
  21. # jq '.tools.dotnet=env.SDK_VERSION' | \
  22. # jq 'del(.tools.runtimes)' \
  23. # > "$reporoot/global.json"
  24. # Restore the original global.json file
  25. #trap "{
  26. # mv "$reporoot/global.bak.json" "$reporoot/global.json"
  27. #}" EXIT
  28. # Build repo tasks
  29. "$reporoot/eng/common/build.sh" --restore --build --ci --configuration Release /p:ProjectToBuild=$reporoot/eng/tools/RepoTasks/RepoTasks.csproj
  30. export DotNetBuildFromSource='true'
  31. # Build projects
  32. "$reporoot/eng/common/build.sh" --restore --build --pack "$@"