mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Start tracking release build information in an azure storage table (#8850)
Start tracking release build information in an azure storage table * Also, fix some issues found when the build is started through a schedule
This commit is contained in:
@@ -91,3 +91,5 @@ jobs:
|
||||
- build_windows_x64
|
||||
- build_windows_x86
|
||||
- build_windows_fxdependent
|
||||
|
||||
- template: templates/updateBuildTable.yml
|
||||
|
||||
@@ -51,6 +51,7 @@ jobs:
|
||||
inputs:
|
||||
signConfigXml: '$(System.ArtifactsDirectory)\package.xml'
|
||||
outPathRoot: '$(Build.StagingDirectory)\signedMacOSPackages'
|
||||
condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual'))
|
||||
|
||||
- template: upload-final-results.yml
|
||||
parameters:
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
jobs:
|
||||
- job: updateBuildTable
|
||||
displayName: Update Build Information Table
|
||||
dependsOn:
|
||||
${{ parameters.parentJobs }}
|
||||
|
||||
# the package ES pools don't have the latest module needed to run this job
|
||||
pool:
|
||||
name: Hosted Mac Internal
|
||||
|
||||
timeoutInMinutes: 15
|
||||
|
||||
steps:
|
||||
- template: SetVersionVariables.yml
|
||||
parameters:
|
||||
ReleaseTagVar: $(ReleaseTagVar)
|
||||
|
||||
- powershell: |
|
||||
install-module azstoragetable.travisez13 -Scope CurrentUser -Force -SkipPublisherCheck
|
||||
displayName: 'Install Azure Table Module'
|
||||
|
||||
- powershell: |
|
||||
$az_key = ConvertTo-SecureString -Force -String '$(az_key)' -AsPlainText
|
||||
$az_key_cred = [PSCredential]::new('$(az_appid)',$az_key)
|
||||
|
||||
Write-Verbose "Connecting to Azure ..." -verbose
|
||||
Connect-AzAccount -ServicePrincipal -Credential $az_key_cred -TenantId '$(az_tenantid)' -force -scope process
|
||||
|
||||
$table = Get-AzStorageTableTable -resourceGroup pscoredata -storageAccountName pscorebuilddata -tableName buildData
|
||||
|
||||
Write-Verbose "Removing existing row, if it exists ..." -verbose
|
||||
$row = Remove-AzStorageTableRow -table $table -partitionkey '$(System.DefinitionId)' -rowKey '$(ReleaseTagVar)'
|
||||
|
||||
Write-Verbose "Adding new row ..." -verbose
|
||||
$result = Add-AzStorageTableRow -table $table -partitionkey '$(System.DefinitionId)' -rowKey '$(ReleaseTagVar)' -property @{
|
||||
buildid = '$(Build.BuildId)'
|
||||
}
|
||||
While(!$result.IsCompleted)
|
||||
{
|
||||
Write-Verbose -message "waiting for result" -verbose
|
||||
Start-Sleep -Seconds 1
|
||||
}
|
||||
|
||||
if(!$result.IsCompletedSuccessfully)
|
||||
{
|
||||
$result
|
||||
throw "adding row failed"
|
||||
}
|
||||
displayName: 'Add Row to Build Information Table'
|
||||
@@ -18,7 +18,7 @@ steps:
|
||||
Destination: AzureBlob
|
||||
storage: '$(StorageAccount)'
|
||||
ContainerName: '$(AzureVersion)'
|
||||
condition: and(succeeded(), eq('${{ parameters.msi }}', 'yes'))
|
||||
condition: and(succeeded(), eq('${{ parameters.msi }}', 'yes'), eq(variables['Build.Reason'], 'Manual'))
|
||||
|
||||
- template: upload-final-results.yml
|
||||
parameters:
|
||||
@@ -33,3 +33,4 @@ steps:
|
||||
Destination: AzureBlob
|
||||
storage: '$(StorageAccount)'
|
||||
ContainerName: '$(AzureVersion)'
|
||||
condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual'))
|
||||
|
||||
Reference in New Issue
Block a user