From d49501446c0a6bdc60dc368cbe4d8078fd32ac4f Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 10 Apr 2018 15:07:20 -0700 Subject: [PATCH 1/5] set build to cleanup --- tools/releaseBuild/macOS/vsts.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/releaseBuild/macOS/vsts.yml b/tools/releaseBuild/macOS/vsts.yml index 26da4047e0e..3e64f82e686 100644 --- a/tools/releaseBuild/macOS/vsts.yml +++ b/tools/releaseBuild/macOS/vsts.yml @@ -1,3 +1,6 @@ +resources: +- repo: self + clean: true steps: #- task: @ # inputs: From afc49a682599b78caf0dc5383915d540f5a1f5ac Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 10 Apr 2018 15:07:56 -0700 Subject: [PATCH 2/5] set build to run on `Hosted macOS Preview` queue --- tools/releaseBuild/macOS/vsts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/releaseBuild/macOS/vsts.yml b/tools/releaseBuild/macOS/vsts.yml index 3e64f82e686..5acbb9c897f 100644 --- a/tools/releaseBuild/macOS/vsts.yml +++ b/tools/releaseBuild/macOS/vsts.yml @@ -1,6 +1,8 @@ resources: - repo: self clean: true +queue: + name: Hosted macOS Preview steps: #- task: @ # inputs: From 61c83a7683428817d4220d8556c2de7a7692b75d Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 10 Apr 2018 15:08:19 -0700 Subject: [PATCH 3/5] set build name format --- tools/releaseBuild/macOS/vsts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/releaseBuild/macOS/vsts.yml b/tools/releaseBuild/macOS/vsts.yml index 5acbb9c897f..88d4f3552b2 100644 --- a/tools/releaseBuild/macOS/vsts.yml +++ b/tools/releaseBuild/macOS/vsts.yml @@ -3,6 +3,7 @@ resources: clean: true queue: name: Hosted macOS Preview +name: macOS_$(Build.SourceBranchName)_$(Rev:.rrr) steps: #- task: @ # inputs: From fa96e1a3539c7c52e1e6cf14cb2f6f56151f29ac Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 10 Apr 2018 15:13:50 -0700 Subject: [PATCH 4/5] replace rev with buildid to enable picking up artifacts in later builds --- tools/releaseBuild/macOS/vsts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/macOS/vsts.yml b/tools/releaseBuild/macOS/vsts.yml index 88d4f3552b2..17efb2592ed 100644 --- a/tools/releaseBuild/macOS/vsts.yml +++ b/tools/releaseBuild/macOS/vsts.yml @@ -3,7 +3,7 @@ resources: clean: true queue: name: Hosted macOS Preview -name: macOS_$(Build.SourceBranchName)_$(Rev:.rrr) +name: macOS_$(Build.SourceBranchName)_$(Build.BuildId) steps: #- task: @ # inputs: From 0f24de010a89e1b2688538fab0d711d1acc04200 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 10 Apr 2018 15:27:17 -0700 Subject: [PATCH 5/5] remove unused build files --- .../releaseBuild/macOS/PowerShellPackage.ps1 | 69 ------------------- tools/releaseBuild/macOS/PowerShellPackage.sh | 1 - 2 files changed, 70 deletions(-) delete mode 100644 tools/releaseBuild/macOS/PowerShellPackage.ps1 delete mode 100644 tools/releaseBuild/macOS/PowerShellPackage.sh diff --git a/tools/releaseBuild/macOS/PowerShellPackage.ps1 b/tools/releaseBuild/macOS/PowerShellPackage.ps1 deleted file mode 100644 index ba4eef86657..00000000000 --- a/tools/releaseBuild/macOS/PowerShellPackage.ps1 +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -# PowerShell Script to build and package PowerShell from specified form and branch -# Script is intented to use in Docker containers -# Ensure PowerShell is available in the provided image - -param ( - # Set default location to where VSTS cloned the repository locally. - [string] $location = $env:BUILD_REPOSITORY_LOCALPATH, - - # Destination location of the package on docker host - [string] $destination = '/mnt', - - [ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")] - [ValidateNotNullOrEmpty()] - [string]$ReleaseTag, - - [ValidateSet("zip", "tar")] - [string[]]$ExtraPackage -) - -# We must build in /PowerShell - -# cleanup the folder but don't delete it or the build agent will loose ownership of the folder -Get-ChildItem -Path /PowerShell/* -Attributes Hidden,Normal,Directory | Remove-Item -Recurse -Force - -# clone the repositor to the location we must build from -git clone $location /PowerShell - -$releaseTagParam = @{} -if ($ReleaseTag) -{ - $releaseTagParam = @{ 'ReleaseTag' = $ReleaseTag } -} - -Push-Location -try { - Set-Location /PowerShell - git submodule update --init --recursive --quiet - Import-Module "/PowerShell/build.psm1" - Import-Module "/PowerShell/tools/packaging" - - Start-PSBootstrap -Package -NoSudo - Start-PSBuild -Crossgen -PSModuleRestore @releaseTagParam - - Start-PSPackage @releaseTagParam - switch ($ExtraPackage) - { - "zip" { Start-PSPackage -Type zip @releaseTagParam } - "tar" { Start-PSPackage -Type tar @releaseTagParam } - } -} -finally -{ - Pop-Location -} - -$linuxPackages = Get-ChildItem "/PowerShell/powershell*" -Include *.pkg,*.zip,*.tar.gz -foreach ($linuxPackage in $linuxPackages) -{ - $filePath = $linuxPackage.FullName - $name = split-path -Leaf -Path $filePath - $extension = (Split-Path -Extension -Path $filePath).Replace('.','') - Write-Verbose "Copying $filePath to $destination" -Verbose - Write-Host "##vso[artifact.upload containerfolder=results;artifactname=$name]$filePath" - Write-Host "##vso[task.setvariable variable=Package-$extension]$filePath" - Copy-Item -Path $filePath -Destination $destination -force -} diff --git a/tools/releaseBuild/macOS/PowerShellPackage.sh b/tools/releaseBuild/macOS/PowerShellPackage.sh deleted file mode 100644 index 10cfeb00ea1..00000000000 --- a/tools/releaseBuild/macOS/PowerShellPackage.sh +++ /dev/null @@ -1 +0,0 @@ -pwsh -command ".\PowerShellPackage.ps1 $*"