Bring preview.5 release fixes to release/v7.5 (#24379)

* added ks2 to release pipeline

* Merged PR 32752: Copy global tools to static site

Rather than an intermediate folder that must be manually copied into the static site.

----
#### AI description  (iteration 1)
#### PR Classification
Code modification to enhance functionality.

#### PR Summary
This pull request updates the release pipeline to copy global tools to a static site.
- Changes in `/.pipelines/templates/release-MakeBlobPublic.yml` to set `prefix` and `destinationPrefix` for blob copying.
- Adjusted destination container name to use `$web` and updated blob naming conventions.

* Merged PR 32759: Switch to single quotes for container name in global tool copy

#### AI description  (iteration 1)
#### PR Classification
Code cleanup

#### PR Summary
This pull request updates the container name string to use single quotes for consistency.
- Changes in `/.pipelines/templates/release-MakeBlobPublic.yml` to switch `$destinationContainerName` from double quotes to single quotes.

* Added condition for make blob public

* moved conditional from global tools to copy

* conditional as a paramter instead of var

* removed dependency

* blob folder name to release Tag

---------

Co-authored-by: Justin Chung <chungjustin@microsoft.com>
Co-authored-by: Patrick Meinecke <pmeinecke@microsoft.com>
This commit is contained in:
Justin Chung
2024-10-03 15:21:14 -07:00
committed by GitHub
co-authored by Justin Chung Patrick Meinecke
parent 34c679ec05
commit 04efcdc3f0
3 changed files with 33 additions and 14 deletions
@@ -21,6 +21,10 @@ parameters: # parameters are shown up in ADO UI in a build queue time
displayName: Skip PMC Publish
type: boolean
default: false
- name: SkipPSInfraInstallers
displayName: Skip Copying Archives and Installers to PSInfrastructure Public Location
type: boolean
default: false
variables:
- name: CDP_DEFINITION_BUILD_COUNT
@@ -75,6 +79,12 @@ resources:
extends:
template: v2/OneBranch.Official.CrossPlat.yml@templates
parameters:
# still using KS2 because we are not yet using a Box Product Deployment
featureFlags:
LinuxHostVersion:
Network: KS2
WindowsHostVersion:
Network: KS2
cloudvault:
enabled: false
globalSdl:
@@ -257,6 +267,8 @@ extends:
dependsOn: UpdateChangeLog
jobs:
- template: /.pipelines/templates/release-MakeBlobPublic.yml@self
parameters:
SkipPSInfraInstallers: ${{ parameters.SkipPSInfraInstallers }}
- stage: PublishGitHubRelease
displayName: Publish GitHub Release
+20 -13
View File
@@ -1,3 +1,9 @@
parameters:
- name: SkipPSInfraInstallers
displayName: Skip Copying Archives and Installers to PSInfrastructure Public Location
type: boolean
default: false
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
parameters:
@@ -9,6 +15,7 @@ jobs:
- job: PSInfraReleaseBlobPublic
displayName: Copy release to PSInfra storage
dependsOn: CopyReleaseBlobApproval
condition: and(succeeded(), ne('${{ parameters.SkipPSInfraInstallers }}', true))
pool:
type: windows
@@ -99,7 +106,6 @@ jobs:
parameters:
displayName: Approve Copy Global tool packages to PSInfra storage
jobName: CopyBlobApproval
dependsOnJob: PSInfraReleaseBlobPublic
instructions: |
Approval for Copy global tool packages to PSInfra storage
@@ -110,14 +116,14 @@ jobs:
type: windows
variables:
- group: 'PSInfraStorage'
- group: 'Azure Blob variable group'
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
- name: ob_sdl_tsa_configFile
value: $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json
- name: ob_sdl_credscan_suppressionsFile
value: $(Build.SourcesDirectory)\PowerShell\.config\suppress.json
- group: 'PSInfraStorage'
- group: 'Azure Blob variable group'
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
- name: ob_sdl_tsa_configFile
value: $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json
- name: ob_sdl_credscan_suppressionsFile
value: $(Build.SourcesDirectory)\PowerShell\.config\suppress.json
steps:
- checkout: self
@@ -156,9 +162,11 @@ jobs:
inline: |
$sourceStorageAccountName = '$(StorageAccount)'
$sourceContainerName = '$(AzureVersion)-nuget'
$prefix = 'globaltool'
$destinationStorageAccountName = '$(PSInfraStorageAccount)'
$destinationContainerName = "tool"
$destinationContainerName = '$web'
$destinationPrefix = 'tool/$(Version)'
$sourceContext = New-AzStorageContext -StorageAccountName $sourceStorageAccountName
Write-Verbose -Verbose "Source context: $($sourceContext.BlobEndPoint)"
@@ -166,19 +174,18 @@ jobs:
$destinationContext = New-AzStorageContext -StorageAccountName $destinationStorageAccountName
Write-Verbose -Verbose "Destination context: $($destinationContext.BlobEndPoint)"
$prefix = 'globaltool'
$blobs = Get-AzStorageBlob -Context $sourceContext -Container $sourceContainerName -Prefix $prefix
Write-Verbose -Verbose "Blobs found in $sourceContainerName"
$blobs.Name | Write-Verbose -Verbose
Write-Verbose -Verbose "Copying blobs from $sourceContainerName to $destinationContainerName"
Write-Verbose -Verbose "Copying blobs from $sourceContainerName to $destinationContainerName/$destinationPrefix"
foreach ($blob in $blobs) {
$sourceBlobName = $blob.Name
Write-Verbose -Verbose "sourceBlobName = $sourceBlobName"
$destinationBlobName = $sourceBlobName -replace "$prefix", '$(Version)'
$destinationBlobName = $sourceBlobName -replace "$prefix", $destinationPrefix
Write-Verbose -Verbose "destinationBlobName = $destinationBlobName"
Copy-AzStorageBlob -SourceContext $sourceContext -DestinationContext $destinationContext -SrcContainer $sourceContainerName -SrcBlob $sourceBlobName -DestContainer $destinationContainerName -DestBlob $destinationBlobName -Force -Verbose -Confirm:$false
+1 -1
View File
@@ -77,7 +77,7 @@ jobs:
$params = @{
ReleaseTag = "$(ReleaseTag)"
AadClientId = "$(PmcCliClientID)"
BlobFolderName = "$(AzureVersion)"
BlobFolderName = "$(ReleaseTag)"
LTS = $metadata.LTSRelease.Latest
ForProduction = $true
SkipPublish = $${{ parameters.skipPublish }}