diff options
author | wtgodbe <wigodbe@microsoft.com> | 2016-04-27 14:35:45 -0700 |
---|---|---|
committer | wtgodbe <wigodbe@microsoft.com> | 2016-05-17 14:06:39 -0700 |
commit | 8568bf1d9722657c602a1f1fe0148e28a93ea8ce (patch) | |
tree | d784a4438e3fe7b74106f1d3e82aa88889024fc4 /publish-packages.sh | |
parent | 41a4ad5054cf877db6aa331855b43ad8678a93ad (diff) | |
download | coreclr-8568bf1d9722657c602a1f1fe0148e28a93ea8ce.tar.gz coreclr-8568bf1d9722657c602a1f1fe0148e28a93ea8ce.tar.bz2 coreclr-8568bf1d9722657c602a1f1fe0148e28a93ea8ce.zip |
Add dev workflow scripts for build pipeline
Diffstat (limited to 'publish-packages.sh')
-rwxr-xr-x | publish-packages.sh | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/publish-packages.sh b/publish-packages.sh new file mode 100755 index 0000000000..5c495e944c --- /dev/null +++ b/publish-packages.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash + +usage() +{ + echo "Publishes the NuGet packages to the specified location." + echo "For publishing to Azure the following properties are required." + echo " /p:CloudDropAccountName=\"account name\"" + echo " /p:CloudDropAccessToken=\"access token\"" + echo " /p:__BuildType=\"Configuration\"" + echo "Configuration can be Release, Checked, or Debug" + exit 1 +} + +working_tree_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +publish_log=$working_tree_root/publish.log + +while [[ $# > 0 ]] +do + unprocessedBuildArgs="$unprocessedBuildArgs $1" + shift +done + +# Use uname to determine what the OS is. +OSName=$(uname -s) +case $OSName in + Linux) + __BuildOS=Linux + ;; + + Darwin) + __BuildOS=OSX + ;; + + FreeBSD) + __BuildOS=FreeBSD + ;; + + OpenBSD) + __BuildOS=OpenBSD + ;; + + NetBSD) + __BuildOS=NetBSD + ;; + + SunOS) + __BuildOS=SunOS + ;; + + *) + echo "Unsupported OS $OSName detected, configuring as if for Linux" + __BuildOS=Linux + ;; +esac + +echo $unprocessedBuildArgs + +options="/nologo /v:minimal /flp:v=detailed;Append;LogFile=$publish_log" + +echo "Running publish-packages.sh $*" > $publish_log + +echo "Running init-tools.sh" +$working_tree_root/init-tools.sh + +echo "Restoring all packages..." +echo -e "\n$working_tree_root/Tools/corerun $working_tree_root/Tools/MSBuild.exe $working_tree_root/src/publish.proj $options $unprocessedBuildArgs" /p:__BuildOS=$__BuildOS >> $publish_log +$working_tree_root/Tools/corerun $working_tree_root/Tools/MSBuild.exe $working_tree_root/src/publish.proj $options $unprocessedBuildArgs /p:__BuildOS=$__BuildOS +if [ $? -ne 0 ] +then + echo -e "\nPackage publishing failed. Aborting." >> $publish_log + echo "ERROR: An error occurred while publishing packages; see $publish_log for more details. There may have been networking problems, so please try again in a few minutes." + exit 1 +fi + +echo "Publish completed successfully." +echo -e "\nPublish completed successfully." >> $publish_log +exit 0
\ No newline at end of file |