-
Notifications
You must be signed in to change notification settings - Fork 26
CHORE: Publish Symbols Pipeline #105
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
base: main
Are you sure you want to change the base?
Changes from 9 commits
56518ec
00a2e00
8e80e7d
0637928
e2a1037
632f13b
080af4f
06caf7e
1e7b296
026f9a8
c6372d1
e219f61
640bf3a
dab82e8
3d68d94
b987d0d
bfab7cf
115b262
864a7ff
4faedbc
2d0265f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,153 @@ | ||
| name: mssql-python-official-release-pipeline | ||
| name: mssql-python-dummy-release-pipeline | ||
|
|
||
| variables: | ||
| - group: 'ESRP Federated Creds (AME)' | ||
|
|
||
| jobs: | ||
| - job: ReleaseESRPPackage | ||
| displayName: 'Release ESRP Package' | ||
| - job: PublishSymbols | ||
| # Use the latest Windows image for building | ||
| pool: | ||
| vmImage: 'windows-latest' | ||
|
|
||
| displayName: 'Publish Symbols - Windows' | ||
| # Strategy matrix to build all combinations | ||
|
|
||
| steps: | ||
| - task: DownloadPipelineArtifact@2 | ||
| inputs: | ||
| buildType: 'specific' | ||
| project: '$(System.TeamProject)' | ||
| definition: 2162 | ||
| buildVersionToDownload: 'latest' | ||
| branchName: '$(Build.SourceBranch)' | ||
| artifactName: 'mssql-python-wheels-dist' | ||
| targetPath: '$(Build.SourcesDirectory)\dist' | ||
| displayName: 'Download release wheel files artifact from latest successful run on main branch' | ||
|
|
||
| # Show content of the downloaded artifact | ||
| - script: | | ||
| echo "Contents of the dist directory:" | ||
| dir "$(Build.SourcesDirectory)\dist" | ||
| displayName: 'List contents of dist directory' | ||
| - task: EsrpRelease@9 | ||
| displayName: 'ESRP Release' | ||
| artifactName: 'mssql-python-symbols' | ||
| targetPath: '$(Build.ArtifactStagingDirectory)\all-pdbs' | ||
| displayName: 'Download PDB files artifact from latest successful run' | ||
|
|
||
| - powershell: 'Write-Host "##vso[task.setvariable variable=ArtifactServices.Symbol.AccountName;]mssql-python"' | ||
| displayName: 'Update Symbol.AccountName with mssql-python' | ||
|
|
||
| - task: PublishSymbols@2 | ||
| displayName: 'Upload symbols to mssql-python org' | ||
bewithgaurav marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| inputs: | ||
| SymbolsFolder: '$(Build.ArtifactStagingDirectory)\all-pdbs' | ||
| SearchPattern: '**/*.pdb' | ||
| IndexSources: false | ||
| SymbolServerType: TeamServices | ||
| SymbolsMaximumWaitTime: 60 | ||
| SymbolExpirationInDays: 1825 # 5 years | ||
| SymbolsProduct: mssql-python | ||
| # Have kept the default version as the build ID, which is unique for each build | ||
| # This will be used to identify the symbols in the symbol server | ||
| SymbolsVersion: $(Build.BuildId) | ||
|
||
| # Default artifact name is the build definition name and build ID | ||
| # This will be used to identify the symbols in the symbol server | ||
| SymbolsArtifactName: $(Build.DefinitionName)-$(Build.BuildId) | ||
| Pat: $(System.AccessToken) | ||
|
|
||
| - task: AzureCLI@2 | ||
| displayName: 'Publish symbols' | ||
| env: | ||
| SymbolServer: '$(SymbolServer)' | ||
| SymbolTokenUri: '$(SymbolTokenUri)' | ||
| requestName: '$(Build.DefinitionName)-$(Build.BuildId)' | ||
|
||
| inputs: | ||
| connectedservicename: '$(ESRPConnectedServiceName)' | ||
| usemanagedidentity: true | ||
| keyvaultname: '$(AuthAKVName)' | ||
| signcertname: '$(AuthSignCertName)' | ||
| clientid: '$(EsrpClientId)' | ||
| Intent: 'PackageDistribution' | ||
| # Changing content type to Maven release (NOT PyPI) since we want to do dummy release | ||
| # for ESRP testing purposes, not for actual PyPI distribution. | ||
| # This is a workaround to allow ESRP to process the release without actual PyPI content | ||
| # and to avoid ESRP validation errors. | ||
| ContentType: 'Maven' | ||
| ContentSource: 'Folder' | ||
| FolderLocation: '$(Build.SourcesDirectory)/dist' | ||
| WaitForReleaseCompletion: true | ||
| Owners: '$(owner)' | ||
| Approvers: '$(approver)' | ||
| ServiceEndpointUrl: 'https://api.esrp.microsoft.com' | ||
| MainPublisher: 'ESRPRELPACMAN' | ||
| DomainTenantId: '$(DomainTenantId)' | ||
| azureSubscription: 'mssql-python-service' | ||
bewithgaurav marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| scriptType: ps | ||
| scriptLocation: inlineScript | ||
| inlineScript: | | ||
| # Should be true by default for internal server | ||
| $publishToInternalServer = $true | ||
| $publishToPublicServer = $false | ||
| echo "Publishing request name: $requestName" | ||
| echo "Publish to internal server: $publishToInternalServer" | ||
| echo "Publish to public server: $publishToPublicServer" | ||
| $symbolServer = '$(SymbolServer)' | ||
| $tokenUri = '$(SymbolTokenUri)' | ||
| $projectName = "mssql-python" | ||
| # Get the access token for the symbol publishing service | ||
| $symbolPublishingToken = az account get-access-token --resource $tokenUri --query accessToken -o tsv | ||
| echo "> 1.Symbol publishing token acquired." | ||
| echo "Registering the request name ..." | ||
| $requestName = '$(requestName)' | ||
| $requestNameRegistrationBody = "{'requestName': '$requestName'}" | ||
| Invoke-RestMethod -Method POST -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json" -Body $requestNameRegistrationBody | ||
| echo "> 2.Registration of request name succeeded." | ||
| echo "Publishing the symbols ..." | ||
| $publishSymbolsBody = "{'publishToInternalServer': $publishToInternalServer, 'publishToPublicServer': $publishToPublicServer}" | ||
| echo "Publishing symbols request body: $publishSymbolsBody" | ||
| Invoke-RestMethod -Method POST -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests/$requestName" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json" -Body $publishSymbolsBody | ||
| echo "> 3.Request to publish symbols succeeded." | ||
| # The following REST calls are used to check publishing status. | ||
| echo "> 4.Checking the status of the request ..." | ||
| Invoke-RestMethod -Method GET -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests/$requestName" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json" | ||
| echo "Use below tables to interpret the values of xxxServerStatus and xxxServerResult fields from the response." | ||
| echo "PublishingStatus" | ||
| echo "-----------------" | ||
| echo "0 NotRequested; The request has not been requested to publish." | ||
| echo "1 Submitted; The request is submitted to be published" | ||
| echo "2 Processing; The request is still being processed" | ||
| echo "3 Completed; The request has been completed processing. It can be failed or successful. Check PublishingResult to get more details" | ||
| echo "PublishingResult" | ||
| echo "-----------------" | ||
| echo "0 Pending; The request has not completed or has not been requested." | ||
| echo "1 Succeeded; The request has published successfully" | ||
| echo "2 Failed; The request has failed to publish" | ||
| echo "3 Cancelled; The request was cancelled" | ||
| # - job: ReleaseESRPPackage | ||
| # displayName: 'Release ESRP Package' | ||
| # pool: | ||
| # vmImage: 'windows-latest' | ||
|
|
||
| # steps: | ||
| # - task: DownloadPipelineArtifact@2 | ||
| # inputs: | ||
| # buildType: 'specific' | ||
| # project: '$(System.TeamProject)' | ||
| # definition: 2162 | ||
| # buildVersionToDownload: 'latest' | ||
| # branchName: '$(Build.SourceBranch)' | ||
| # artifactName: 'mssql-python-wheels-dist' | ||
| # targetPath: '$(Build.SourcesDirectory)\dist' | ||
| # displayName: 'Download release wheel files artifact from latest successful run on main branch' | ||
|
|
||
| # # Show content of the downloaded artifact | ||
| # - script: | | ||
| # echo "Contents of the dist directory:" | ||
| # dir "$(Build.SourcesDirectory)\dist" | ||
| # displayName: 'List contents of dist directory' | ||
|
|
||
| # - task: EsrpRelease@9 | ||
| # displayName: 'ESRP Release' | ||
| # inputs: | ||
| # connectedservicename: '$(ESRPConnectedServiceName)' | ||
| # usemanagedidentity: true | ||
| # keyvaultname: '$(AuthAKVName)' | ||
| # signcertname: '$(AuthSignCertName)' | ||
| # clientid: '$(EsrpClientId)' | ||
| # Intent: 'PackageDistribution' | ||
| # # Changing content type to Maven release (NOT PyPI) since we want to do dummy release | ||
| # # for ESRP testing purposes, not for actual PyPI distribution. | ||
| # # This is a workaround to allow ESRP to process the release without actual PyPI content | ||
| # # and to avoid ESRP validation errors. | ||
| # ContentType: 'Maven' | ||
| # ContentSource: 'Folder' | ||
| # FolderLocation: '$(Build.SourcesDirectory)/dist' | ||
| # WaitForReleaseCompletion: true | ||
| # Owners: '$(owner)' | ||
| # Approvers: '$(approver)' | ||
| # ServiceEndpointUrl: 'https://api.esrp.microsoft.com' | ||
| # MainPublisher: 'ESRPRELPACMAN' | ||
| # DomainTenantId: '$(DomainTenantId)' | ||
Uh oh!
There was an error while loading. Please reload this page.