Merged PR 5818: Port changes to allow AzDevOps NuGet feeds for Mac build

Port changes to allow AzDevOps NuGet feeds for Mac build
This commit is contained in:
Travis Plunk
2018-11-14 01:04:39 +00:00
committed by Aditya Patwardhan
parent 79f21b41de
commit ab809d95d9
3 changed files with 24 additions and 26 deletions
+8 -1
View File
@@ -767,6 +767,7 @@ function New-UnixPackage {
$ManGzipInfo = New-ManGzip -IsPreview:$IsPreview
# Change permissions for packaging
Write-Log "Setting permissions..."
Start-NativeExecution {
find $Staging -type d | xargs chmod 755
find $Staging -type f | xargs chmod 644
@@ -779,6 +780,7 @@ function New-UnixPackage {
# Add macOS powershell launcher
if ($Type -eq "osxpkg")
{
Write-Log "Adding macOS launch opplication..."
if ($pscmdlet.ShouldProcess("Add macOS launch application"))
{
# Generate launcher app folder
@@ -816,10 +818,12 @@ function New-UnixPackage {
# Build package
try {
if ($pscmdlet.ShouldProcess("Create $type package")) {
Write-Log "Creating package with fpm..."
$Output = Start-NativeExecution { fpm $Arguments }
}
} finally {
if ($Environment.IsMacOS) {
Write-Log "Starting Cleanup for mac packaging..."
if ($pscmdlet.ShouldProcess("Cleanup macOS launcher"))
{
Clear-MacOSLauncher
@@ -1203,6 +1207,7 @@ function New-ManGzip
$IsPreview
)
Write-Log "Creating man gz..."
# run ronn to convert man page to roff
$RonnFile = "$RepoRoot/assets/pwsh.1.ronn"
if ($IsPreview.IsPresent)
@@ -1215,7 +1220,8 @@ function New-ManGzip
$RoffFile = $RonnFile -replace "\.ronn$"
# Run ronn on assets file
Start-NativeExecution { ronn --roff $RonnFile } -VerboseOutputOnError
Write-Log "Creating man gz - running ronn..."
Start-NativeExecution { ronn --roff $RonnFile }
if ($IsPreview.IsPresent)
{
@@ -1224,6 +1230,7 @@ function New-ManGzip
# gzip in assets directory
$GzipFile = "$RoffFile.gz"
Write-Log "Creating man gz - running gzip..."
Start-NativeExecution { gzip -f $RoffFile } -VerboseOutputOnError
$ManFile = Join-Path "/usr/local/share/man/man1" (Split-Path -Leaf $GzipFile)
@@ -29,27 +29,15 @@ param (
[switch] $Build
)
# We must build in /PowerShell
$repoRoot = '/PowerShell'
if ($BootStrap.IsPresent) {
$repoRoot = $location
}
$repoRoot = $location
if ($Build.IsPresent) {
# cleanup the folder but don't delete it or the build agent will loose ownership of the folder
Write-Verbose -Message "cleaning /PowerShell" -Verbose
Get-ChildItem -Path /PowerShell/* -Attributes Hidden, Normal, Directory | Remove-Item -Recurse -Force
# clone the repository to the location we must build from
Write-Verbose -Message "cloning to /PowerShell" -Verbose
git clone $location /PowerShell
$releaseTagParam = @{}
if ($ReleaseTag) {
$releaseTagParam = @{ 'ReleaseTag' = $ReleaseTag }
}
}
Push-Location
try {
Write-Verbose -Message "Init..." -Verbose
+15 -12
View File
@@ -14,16 +14,6 @@ steps:
scriptPath: 'tools/releaseBuild/setReleaseTag.sh'
args: '-ReleaseTag $(ReleaseTagVar) -Variable "ReleaseTagVar"'
displayName: 'Calculate Release Tag'
- powershell: |
Import-Module $(Build.SourcesDirectory)/build.psm1 -Force
New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT) -FeedName AzDevOpsFeed -Destination $(Build.SourcesDirectory)/src/Modules
if(-not (Test-Path "$(Build.SourcesDirectory)/src/Modules/nuget.config"))
{
throw "nuget.config is not created"
}
displayName: 'Add nuget.config for AzDevOps feed for PSGallery modules '
condition: ne(Variable['SkipFxDependent'], 'true')
- task: ShellScript@2
inputs:
scriptPath: 'tools/installpsh-osx.sh'
@@ -32,13 +22,26 @@ steps:
inputs:
scriptPath: 'tools/releaseBuild/macOS/createPowerShell.sh'
displayName: 'Create /PowerShell'
- powershell: |
Write-Host "##vso[task.setvariable variable=PowerShellRoot]/PowerShell"
git clone $env:BUILD_REPOSITORY_LOCALPATH /PowerShell
displayName: Clone PowerShell Repo to /PowerShell
- task: ShellScript@2
inputs:
scriptPath: 'tools/releaseBuild/macOS/PowerShellPackageVsts.sh'
args: '-location $(Build.SourcesDirectory) -BootStrap'
args: '-location $(PowerShellRoot) -BootStrap'
displayName: 'Bootstrap VM'
- powershell: |
Import-Module $(Build.SourcesDirectory)/build.psm1 -Force
New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT) -FeedName AzDevOpsFeed -Destination "$(PowerShellRoot)/src/Modules"
if(-not (Test-Path "$(PowerShellRoot)/src/Modules/nuget.config"))
{
throw "nuget.config is not created"
}
displayName: 'Add nuget.config for AzDevOps feed for PSGallery modules '
- powershell: |
$env:AZDEVOPSFEEDPAT = '$(AzDevOpsFeedPAT)'
$(Build.SourcesDirectory)/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 -ReleaseTag $(ReleaseTagVar) -Destination $(System.ArtifactsDirectory) -ExtraPackage "tar" -location $(Build.SourcesDirectory) -Build
$(Build.SourcesDirectory)/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 -ReleaseTag $(ReleaseTagVar) -Destination $(System.ArtifactsDirectory) -ExtraPackage "tar" -location $(PowerShellRoot) -Build
$env:AZDEVOPSFEEDPAT = $null
displayName: 'Build and Package'