diff --git a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 index f206747ac1..d797e567e1 100644 --- a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 @@ -58,3 +58,20 @@ foreach ($linuxPackage in $linuxPackages) Write-Verbose "Copying $filePath to $destination" -Verbose Copy-Item -Path $filePath -Destination $destination -force } + +Write-Verbose "Exporting project.assets files ..." -verbose + +$projectAssetsCounter = 1 +$projectAssetsFolder = Join-Path -Path $destination -ChildPath 'projectAssets' +$projectAssetsZip = Join-Path -Path $destination -ChildPath 'projectAssetssymbols.zip' +Get-ChildItem $location\project.assets.json -Recurse | ForEach-Object { + $itemDestination = Join-Path -Path $projectAssetsFolder -ChildPath $projectAssetsCounter + New-Item -Path $itemDestination -ItemType Directory -Force + $file = $_.FullName + Write-Verbose "Copying $file to $itemDestination" -verbose + Copy-Item -Path $file -Destination "$itemDestination\" -Force + $projectAssetsCounter++ +} + +Compress-Archive -Path $projectAssetsFolder -DestinationPath $projectAssetsZip +Remove-Item -Path $projectAssetsFolder -Recurse -Force -ErrorAction SilentlyContinue diff --git a/tools/releaseBuild/Images/microsoft_powershell_alpine3/Dockerfile b/tools/releaseBuild/Images/microsoft_powershell_alpine3/Dockerfile index feea186d5e..4bdbd2a0af 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_alpine3/Dockerfile +++ b/tools/releaseBuild/Images/microsoft_powershell_alpine3/Dockerfile @@ -7,4 +7,6 @@ LABEL maintainer="PowerShell Team " RUN apk update \ && apk add cmake clang build-base git bash +ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + COPY build-and-run-pwsh.sh / diff --git a/tools/releaseBuild/Images/microsoft_powershell_centos7/Dockerfile b/tools/releaseBuild/Images/microsoft_powershell_centos7/Dockerfile index b7a5997182..10955fbf67 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_centos7/Dockerfile +++ b/tools/releaseBuild/Images/microsoft_powershell_centos7/Dockerfile @@ -23,5 +23,7 @@ RUN yum install -y \ COPY PowerShellPackage.ps1 / +ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + # Use PowerShell as the default shell ENTRYPOINT [ "pwsh" ] diff --git a/tools/releaseBuild/Images/microsoft_powershell_ubuntu14.04/Dockerfile b/tools/releaseBuild/Images/microsoft_powershell_ubuntu14.04/Dockerfile index debdc50b07..7eb7a6d613 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_ubuntu14.04/Dockerfile +++ b/tools/releaseBuild/Images/microsoft_powershell_ubuntu14.04/Dockerfile @@ -32,5 +32,7 @@ RUN apt-get update \ COPY PowerShellPackage.ps1 / +ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + # Use PowerShell as the default shell ENTRYPOINT [ "pwsh" ] diff --git a/tools/releaseBuild/Images/microsoft_powershell_ubuntu16.04/Dockerfile b/tools/releaseBuild/Images/microsoft_powershell_ubuntu16.04/Dockerfile index 5c036ebab2..7c6779f0a0 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_ubuntu16.04/Dockerfile +++ b/tools/releaseBuild/Images/microsoft_powershell_ubuntu16.04/Dockerfile @@ -30,5 +30,7 @@ RUN apt-get update \ COPY PowerShellPackage.ps1 / +ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + # Use PowerShell as the default shell ENTRYPOINT [ "pwsh" ] diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/DockerFile b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/DockerFile index c8be0a943e..f6ebd133b4 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/DockerFile +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/DockerFile @@ -21,4 +21,6 @@ RUN Import-Module ./containerFiles/wix.psm1; ` COPY PowerShellPackage.ps1 / +ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + ENTRYPOINT ["C:\\Program Files\\PowerShell\\latest\\pwsh.exe", "-command"] diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 index b725a75fe3..fd5669657e 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 @@ -25,7 +25,10 @@ param ( [Parameter(Mandatory,ParameterSetName='packageSigned')] [ValidatePattern("-signed.zip$")] - [string]$BuildZip + [string]$BuildZip, + + [Parameter(Mandatory,ParameterSetName='ComponentRegistration')] + [switch] $ComponentRegistration ) $releaseTagParam = @{} @@ -92,24 +95,46 @@ try{ } $pspackageParams = @{'Type'='msi'; 'WindowsRuntime'=$Runtime} - if(!$Symbols.IsPresent -and $Runtime -notmatch "arm") + if(!$ComponentRegistration.IsPresent -and !$Symbols.IsPresent -and $Runtime -notmatch "arm") { Write-Verbose "Starting powershell packaging(msi)..." -verbose Start-PSPackage @pspackageParams @releaseTagParam } - $pspackageParams['Type']='zip' - $pspackageParams['IncludeSymbols']=$Symbols.IsPresent - Write-Verbose "Starting powershell packaging(zip)..." -verbose - Start-PSPackage @pspackageParams @releaseTagParam + if(!$ComponentRegistration.IsPresent) + { + $pspackageParams['Type']='zip' + $pspackageParams['IncludeSymbols']=$Symbols.IsPresent + Write-Verbose "Starting powershell packaging(zip)..." -verbose + Start-PSPackage @pspackageParams @releaseTagParam - Write-Verbose "Exporting packages ..." -verbose + Write-Verbose "Exporting packages ..." -verbose - Get-ChildItem $location\*.msi,$location\*.zip,$location\*.wixpdb | ForEach-Object { - $file = $_.FullName - Write-Verbose "Copying $file to $destination" -verbose - Copy-Item -Path $file -Destination "$destination\" -Force + Get-ChildItem $location\*.msi,$location\*.zip,$location\*.wixpdb | ForEach-Object { + $file = $_.FullName + Write-Verbose "Copying $file to $destination" -verbose + Copy-Item -Path $file -Destination "$destination\" -Force + } } + else { + Write-Verbose "Exporting project.assets files ..." -verbose + + $projectAssetsCounter = 1 + $projectAssetsFolder = Join-Path -Path $destination -ChildPath 'projectAssets' + $projectAssetsZip = Join-Path -Path $destination -ChildPath 'projectAssetssymbols.zip' + Get-ChildItem $location\project.assets.json -Recurse | ForEach-Object { + $itemDestination = Join-Path -Path $projectAssetsFolder -ChildPath $projectAssetsCounter + New-Item -Path $itemDestination -ItemType Directory -Force + $file = $_.FullName + Write-Verbose "Copying $file to $itemDestination" -verbose + Copy-Item -Path $file -Destination "$itemDestination\" -Force + $projectAssetsCounter++ + } + + Compress-Archive -Path $projectAssetsFolder -DestinationPath $projectAssetsZip + Remove-Item -Path $projectAssetsFolder -Recurse -Force -ErrorAction SilentlyContinue + } + } finally { diff --git a/tools/releaseBuild/build.json b/tools/releaseBuild/build.json index 25263f97f1..d14322c670 100644 --- a/tools/releaseBuild/build.json +++ b/tools/releaseBuild/build.json @@ -34,6 +34,25 @@ "DockerImageName": "ps-winsrvcore", "BinaryBucket": "release" }, + { + "Name": "win-x64-component-registration", + "RepoDestinationPath": "C:\\PowerShell", + "BuildCommand": "C:\\PowerShellPackage.ps1 -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win7-x64 -ReleaseTag _ReleaseTag_ -ComponentRegistration", + "BuildDockerOptions": [ + "-m", + "3968m" + ], + "DockerFile": ".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\DockerFile", + "AdditionalContextFiles" :[ + ".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\PowerShellPackage.ps1", + ".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\wix.psm1", + ".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\dockerInstall.psm1" + ], + "DockerImageName": "ps-winsrvcore", + "BinaryBucket": "results", + "ArtifactsExpected": 1, + "VariableForExtractedBinariesPath": "componentregistration" + }, { "Name": "win-x64-symbols", "RepoDestinationPath": "C:\\PowerShell",