-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Start tracking release build information in an azure storage table #8850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
TravisEz13
merged 8 commits into
PowerShell:master
from
TravisEz13:Add_table_row_for_release_build
Feb 12, 2019
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cb959f1
Add job to update the build information table
TravisEz13 453e585
fix issues with scheduled builds
TravisEz13 e89fd0c
move to pool that has latest az module
TravisEz13 4bafb43
add comment explainting use of mac internal pool
TravisEz13 e6574bd
add wait loop
TravisEz13 9b9f79c
fix a typo
TravisEz13 03942c8
Address PR Comments
TravisEz13 8ee637c
Fix codefactor issues
TravisEz13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
tools/releaseBuild/azureDevOps/templates/updateBuildTable.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) | ||
|
TravisEz13 marked this conversation as resolved.
|
||
| { | ||
| $result | ||
| throw "adding row failed" | ||
| } | ||
| displayName: 'Add Row to Build Information Table' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.