From 99a78afd8d2d7902c7e8b1d6ceb87dad62dbfdfc Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Wed, 18 Jan 2017 12:46:58 -0600 Subject: Split pipeline build to match CoreFX's model. (#2505) * Split pipeline build to match CoreFX's model. - OS-specific legs no longer publish to MyGet, they just upload to Azure. - New publish leg downloads from Azure and publishes to MyGet. - Only includes Microsoft.TargetingPack.Private.CoreRT for now, will add ILCompiler after we sort out what OS-specific packages should be named. * Addressing code review feedback (PR#2505). --- buildscripts/publish-packages.cmd | 40 ++++++++++++++++++++++++++++++++ buildscripts/publish-packages.sh | 33 ++++++++++++++++++++++++++ buildscripts/publish.proj | 20 ++++++++++++++++ buildscripts/syncAzure.proj | 19 +++++++++++++++ buildscripts/updatePublishedVersions.ps1 | 26 +++++++++++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 buildscripts/publish-packages.cmd create mode 100755 buildscripts/publish-packages.sh create mode 100644 buildscripts/publish.proj create mode 100644 buildscripts/syncAzure.proj create mode 100644 buildscripts/updatePublishedVersions.ps1 (limited to 'buildscripts') diff --git a/buildscripts/publish-packages.cmd b/buildscripts/publish-packages.cmd new file mode 100644 index 000000000..633ff7199 --- /dev/null +++ b/buildscripts/publish-packages.cmd @@ -0,0 +1,40 @@ +@echo off +REM don't pass args to buildvars-setup, just get defaults +call %~dp0buildvars-setup.cmd + +set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" +if not exist %_msbuildexe% (set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe") +REM hopefully it's on the path +if not exist %_msbuildexe% set _msbuildexe=msbuild + +set AzureAccount= +set AzureToken= +set Container= + +:Arg_Loop +if "%1" == "" goto ArgsDone + +if /i "%1" == "-AzureAccount" (set AzureAccount=%2&shift&shift&goto Arg_Loop) +if /i "%1" == "-AzureToken" (set AzureToken=%2&shift&shift&goto Arg_Loop) +if /i "%1" == "-Container" (set Container=%2&shift&shift&goto Arg_Loop) + +echo Invalid command line argument: %1 +exit /b 1 +:ArgsDone + +set AzureToken=%AzureToken:"=% + +if "%AzureAccount%" == "" ( + echo Azure account not specified. + exit /b 1 +) +if "%AzureToken%" == "" ( + echo Azure token not specified. + exit /b 1 +) +if "%Container%" == "" ( + echo Azure container not specified. + exit /b 1 +) + +%_msbuildexe% %__ProjectDir%\buildscripts\publish.proj /p:CloudDropAccountName=%AzureAccount% /p:CloudDropAccessToken=%AzureToken% /p:ContainerName=%Container% /flp:v=diag;LogFile=publish-packages.log \ No newline at end of file diff --git a/buildscripts/publish-packages.sh b/buildscripts/publish-packages.sh new file mode 100755 index 000000000..a1632ed15 --- /dev/null +++ b/buildscripts/publish-packages.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +export AzureAccount= +export AzureToken= +export Container= + +while [ "$1" != "" ]; do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + -azureaccount) + shift + export AzureAccount=$1 + ;; + -azuretoken) + shift + export AzureToken=$1 + ;; + -container) + shift + export Container=$1 + ;; + *) + echo Bad argument $1 + exit 1 + esac + shift +done + +# don't pass args to buildvars-setup, just get defaults +scriptRoot="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +. $scriptRoot/buildvars-setup.sh + +$__ProjectRoot/Tools/msbuild.sh $scriptRoot/publish.proj /p:CloudDropAccountName=$AzureAccount /p:CloudDropAccessToken=$AzureToken /p:ContainerName=$Container "/flp:v=diag;LogFile=publish-packages.log" \ No newline at end of file diff --git a/buildscripts/publish.proj b/buildscripts/publish.proj new file mode 100644 index 000000000..25731c681 --- /dev/null +++ b/buildscripts/publish.proj @@ -0,0 +1,20 @@ + + + + + + + + $(PackageOutputRoot)**\*.nupkg + + + + + corert-$(PreReleaseLabel)-$(BuildNumberMajor)-$(BuildNumberMinor) + + + + + \ No newline at end of file diff --git a/buildscripts/syncAzure.proj b/buildscripts/syncAzure.proj new file mode 100644 index 000000000..5e5c3bcc8 --- /dev/null +++ b/buildscripts/syncAzure.proj @@ -0,0 +1,19 @@ + + + + + + corert-$(PreReleaseLabel) + $(ContainerNamePrefix)-$(BuildNumberMajor)-$(BuildNumberMinor) + $(PackagesDir)AzureTransfer + + + + + + + + + + + \ No newline at end of file diff --git a/buildscripts/updatePublishedVersions.ps1 b/buildscripts/updatePublishedVersions.ps1 new file mode 100644 index 000000000..465bb4e70 --- /dev/null +++ b/buildscripts/updatePublishedVersions.ps1 @@ -0,0 +1,26 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +# This script updates the dotnet/versions repository based on a set of packages. It directly +# commits the changes using GitHub APIs. + +param( + [Parameter(Mandatory=$true)][string]$gitHubUser, + [Parameter(Mandatory=$true)][string]$gitHubEmail, + [Parameter(Mandatory=$true)][string]$gitHubAuthToken, + [Parameter(Mandatory=$true)][string]$versionsRepoOwner, + [Parameter(Mandatory=$true)][string]$versionsRepo, + [Parameter(Mandatory=$true)][string]$versionsRepoPath, + # A pattern matching all packages in the set that the versions repository should be set to. + [Parameter(Mandatory=$true)][string]$nupkgPath) + +msbuild /t:UpdatePublishedVersions ` + /p:GitHubUser="$gitHubUser" ` + /p:GitHubEmail="$gitHubEmail" ` + /p:GitHubAuthToken="$gitHubAuthToken" ` + /p:VersionsRepoOwner="$versionsRepoOwner" ` + /p:VersionsRepo="$versionsRepo" ` + /p:VersionsRepoPath="$versionsRepoPath" ` + /p:ShippedNuGetPackageGlobPath="$nupkgPath" \ No newline at end of file -- cgit v1.2.3