Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions .pipelines/templates/release-MakeBlobPublic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,24 @@ jobs:
displayName: 'Capture Environment Variables'

- pwsh: |
Write-Host 'Available Az.Accounts and Az.Storage modules before installation:'
$availableModules = Get-Module -Name Az.Accounts, Az.Storage -ListAvailable |
Sort-Object Name, Version -Descending |
Select-Object Name, Version, ModuleBase
if ($availableModules) {
$availableModules | Format-Table -AutoSize | Out-String -Width 9999 | Write-Host
} else {
Write-Host 'No Az.Accounts or Az.Storage modules are available.'
}

$repositoryName = 'PowerShellGalleryMirror'
if (-not (Get-PSRepository -Name $repositoryName -ErrorAction Ignore)) {
Register-PSRepository -Name $repositoryName -SourceLocation 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v2' -InstallationPolicy Trusted -ErrorAction Stop
$repositorySourceLocation = 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v2'
Unregister-PSRepository -Name $repositoryName -ErrorAction Ignore
Register-PSRepository -Name $repositoryName -SourceLocation $repositorySourceLocation -InstallationPolicy Trusted -ErrorAction Stop

$registeredSourceLocation = (Get-PSRepository -Name $repositoryName -ErrorAction Stop).SourceLocation
if ($registeredSourceLocation.TrimEnd('/') -ne $repositorySourceLocation.TrimEnd('/')) {
throw "Repository '$repositoryName' has unexpected source location '$registeredSourceLocation'."
}
Install-Module -Repository $repositoryName -Name Az.Storage -RequiredVersion 9.7.2 -Scope CurrentUser -Force -ErrorAction Stop
displayName: Install Az.Storage 9.7.2
Expand Down Expand Up @@ -148,9 +163,24 @@ jobs:
displayName: 'Capture Environment Variables'

- pwsh: |
Write-Host 'Available Az.Accounts and Az.Storage modules before installation:'
$availableModules = Get-Module -Name Az.Accounts, Az.Storage -ListAvailable |
Sort-Object Name, Version -Descending |
Select-Object Name, Version, ModuleBase
if ($availableModules) {
$availableModules | Format-Table -AutoSize | Out-String -Width 9999 | Write-Host
} else {
Write-Host 'No Az.Accounts or Az.Storage modules are available.'
}

$repositoryName = 'PowerShellGalleryMirror'
if (-not (Get-PSRepository -Name $repositoryName -ErrorAction Ignore)) {
Register-PSRepository -Name $repositoryName -SourceLocation 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v2' -InstallationPolicy Trusted -ErrorAction Stop
$repositorySourceLocation = 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v2'
Unregister-PSRepository -Name $repositoryName -ErrorAction Ignore
Register-PSRepository -Name $repositoryName -SourceLocation $repositorySourceLocation -InstallationPolicy Trusted -ErrorAction Stop

$registeredSourceLocation = (Get-PSRepository -Name $repositoryName -ErrorAction Stop).SourceLocation
if ($registeredSourceLocation.TrimEnd('/') -ne $repositorySourceLocation.TrimEnd('/')) {
throw "Repository '$repositoryName' has unexpected source location '$registeredSourceLocation'."
}
Install-Module -Repository $repositoryName -Name Az.Storage -RequiredVersion 9.7.2 -Scope CurrentUser -Force -ErrorAction Stop
displayName: Install Az.Storage 9.7.2
Expand Down
19 changes: 17 additions & 2 deletions .pipelines/templates/release-upload-buildinfo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,24 @@ jobs:
displayName: Create json files

- pwsh: |
Write-Host 'Available Az.Accounts and Az.Storage modules before installation:'
$availableModules = Get-Module -Name Az.Accounts, Az.Storage -ListAvailable |
Sort-Object Name, Version -Descending |
Select-Object Name, Version, ModuleBase
if ($availableModules) {
$availableModules | Format-Table -AutoSize | Out-String -Width 9999 | Write-Host
} else {
Write-Host 'No Az.Accounts or Az.Storage modules are available.'
}

$repositoryName = 'PowerShellGalleryMirror'
if (-not (Get-PSRepository -Name $repositoryName -ErrorAction Ignore)) {
Register-PSRepository -Name $repositoryName -SourceLocation 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v2' -InstallationPolicy Trusted -ErrorAction Stop
$repositorySourceLocation = 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v2'
Unregister-PSRepository -Name $repositoryName -ErrorAction Ignore
Register-PSRepository -Name $repositoryName -SourceLocation $repositorySourceLocation -InstallationPolicy Trusted -ErrorAction Stop

$registeredSourceLocation = (Get-PSRepository -Name $repositoryName -ErrorAction Stop).SourceLocation
if ($registeredSourceLocation.TrimEnd('/') -ne $repositorySourceLocation.TrimEnd('/')) {
throw "Repository '$repositoryName' has unexpected source location '$registeredSourceLocation'."
}
Install-Module -Repository $repositoryName -Name Az.Storage -RequiredVersion 9.7.2 -Scope CurrentUser -Force -ErrorAction Stop
displayName: Install Az.Storage 9.7.2
Expand Down
30 changes: 6 additions & 24 deletions test/packaging/packaging.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -134,34 +134,16 @@ Describe "Packaging Module Functions" {
$mapping = Get-Content -Path $mappingPath -Raw | ConvertFrom-Json
}

It "Should map stable <Architecture> packages to <Url>" -TestCases @(
@{
Architecture = "x86_64"
Url = "azurelinux-4-prod-microsoft-x86_64"
}
@{
Architecture = "aarch64"
Url = "azurelinux-4-prod-microsoft-aarch64"
}
) {
param($Architecture, $Url)

$mappedPackage = @($mapping.Packages | Where-Object url -EQ $Url)
$mappedPackage.Count | Should -Be 1
$mappedPackage[0].channel | Should -BeExactly "stable"
$mappedPackage[0].distribution | Should -BeExactly @("azl")
$mappedPackage[0].PackageFormat |
Should -BeExactly "PACKAGE_NAME-POWERSHELL_RELEASE-1.azl4.$Architecture.rpm"
}

It "Should not map preview packages to Azure Linux 4" {
@(
It "Should not map packages to Azure Linux 4" {
$azureLinux4Mappings = @(
$mapping.Packages |
Where-Object {
$_.channel -eq "preview" -and
$_.url -like "azurelinux-4*" -or
$_.PackageFormat -match "\.azl4\."
}
).Count | Should -Be 0
)

$azureLinux4Mappings | Should -BeNullOrEmpty
}

It "Should remove the Azure Linux 4 beta mappings" {
Expand Down
16 changes: 0 additions & 16 deletions tools/packages.microsoft.com/mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,6 @@
"PackageFormat": "PACKAGE_NAME-POWERSHELL_RELEASE-1.cm.x86_64.rpm",
"channel": "preview"
},
{
"url": "azurelinux-4-prod-microsoft-x86_64",
"distribution": [
"azl"
],
"PackageFormat": "PACKAGE_NAME-POWERSHELL_RELEASE-1.azl4.x86_64.rpm",
"channel": "stable"
},
{
"url": "azurelinux-4-prod-microsoft-aarch64",
"distribution": [
"azl"
],
"PackageFormat": "PACKAGE_NAME-POWERSHELL_RELEASE-1.azl4.aarch64.rpm",
"channel": "stable"
},
{
"url": "microsoft-debian-stretch-prod",
"distribution": [
Expand Down
Loading