Skip to content

Commit 115b262

Browse files
committed
use onebranch temp
1 parent bfab7cf commit 115b262

1 file changed

Lines changed: 162 additions & 135 deletions

File tree

eng/pipelines/dummy-release-pipeline.yml

Lines changed: 162 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -10,141 +10,168 @@ extends:
1010
parameters:
1111
featureFlags:
1212
WindowsHostVersion: 1ESWindows2022
13-
14-
stages:
15-
- stage: PublishSymbols
16-
displayName: 'Publish Symbols'
17-
jobs:
18-
- job: PublishSymbols
19-
# Use the latest Windows image for building
20-
pool:
21-
vmImage: 'windows-latest'
22-
displayName: 'Publish Symbols - Windows'
23-
# Strategy matrix to build all combinations
24-
25-
steps:
26-
- task: UsePythonVersion@0
27-
inputs:
28-
versionSpec: '3.13'
29-
architecture: 'x64'
30-
addToPath: true
31-
displayName: 'Use Python 3.13'
32-
33-
# Install required packages: pip, CMake, pybind11
34-
- script: |
35-
python -m pip install --upgrade pip
36-
pip install -r requirements.txt
37-
pip install cmake pybind11
38-
displayName: 'Install dependencies'
39-
40-
# Generate the symbols for the mssql-python package using build.bat
41-
- script: |
42-
echo "Generating symbols for mssql-python package..."
43-
cd mssql_python\pybind
44-
build.bat
45-
cd ..
46-
dir /s /b
47-
displayName: 'Generate symbols for mssql-python package'
48-
49-
# Copy the generated symbols to the staging folder for artifacts
50-
- task: CopyFiles@2
51-
inputs:
52-
SourceFolder: '$(Build.SourcesDirectory)\mssql_python'
53-
Contents: '**\*.pdb'
54-
TargetFolder: '$(Build.ArtifactStagingDirectory)\mssql-python-symbols'
55-
displayName: 'Copy symbols to staging folder'
56-
57-
# Publish the symbols (only pdbs) as an artifact
58-
- task: PublishBuildArtifacts@1
59-
displayName: 'Publish symbols as build artifact'
60-
inputs:
61-
PathtoPublish: '$(Build.ArtifactStagingDirectory)\mssql-python-symbols'
62-
ArtifactName: 'mssql-python-symbols'
63-
publishLocation: 'Container'
64-
65-
- powershell: 'Write-Host "##vso[task.setvariable variable=ArtifactServices.Symbol.AccountName;]SqlClientDrivers"'
66-
displayName: 'Update Symbol.AccountName with SqlClientDrivers'
67-
68-
- task: PublishSymbols@2
69-
displayName: 'Upload symbols to SqlClientDrivers org'
70-
inputs:
71-
SymbolsFolder: '$(Build.ArtifactStagingDirectory)\mssql-python-symbols'
72-
SearchPattern: '**/*.pdb'
73-
IndexSources: false
74-
SymbolServerType: TeamServices
75-
SymbolsMaximumWaitTime: 60
76-
SymbolExpirationInDays: 1825 # 5 years
77-
SymbolsProduct: mssql-python
78-
# Have kept the default version as the build ID, which is unique for each build
79-
# This will be used to identify the symbols in the symbol server
80-
SymbolsVersion: $(Build.BuildId)
81-
# Ensuring the symbols are uniquely identified
82-
# MDS uses symbolsArtifactName as mds_symbols_$(System.TeamProject)_$(Build.Repository.Name)_$(Build.SourceBranchName)_$(NuGetPackageVersion)_$(System.TimelineId)
83-
SymbolsArtifactName: $(System.TeamProject)-$(Build.SourceBranchName)-$(Build.DefinitionName)-$(Build.BuildId)
84-
Pat: $(System.AccessToken)
85-
86-
- task: AzureCLI@2
87-
displayName: 'Publish symbols'
88-
env:
89-
SymbolServer: '$(SymbolServer)'
90-
SymbolTokenUri: '$(SymbolTokenUri)'
91-
requestName: '$(System.TeamProject)-$(Build.SourceBranchName)-$(Build.DefinitionName)-$(Build.BuildId)'
92-
inputs:
93-
azureSubscription: 'SymbolsPublishing-msodbcsql-mssql-python'
94-
scriptType: ps
95-
scriptLocation: inlineScript
96-
inlineScript: |
97-
# Should be true by default for internal server
98-
$publishToInternalServer = $true
99-
$publishToPublicServer = $false
100-
101-
echo "Publishing request name: $requestName"
102-
echo "Publish to internal server: $publishToInternalServer"
103-
echo "Publish to public server: $publishToPublicServer"
104-
105-
$symbolServer = '$(SymbolServer)'
106-
$tokenUri = '$(SymbolTokenUri)'
107-
$projectName = "mssql-python"
108-
109-
# Get the access token for the symbol publishing service
110-
$symbolPublishingToken = az account get-access-token --resource $tokenUri --query accessToken -o tsv
111-
112-
echo "> 1.Symbol publishing token acquired."
113-
114-
echo "Registering the request name ..."
115-
$requestName = '$(requestName)'
116-
$requestNameRegistrationBody = "{'requestName': '$requestName'}"
117-
Invoke-RestMethod -Method POST -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json" -Body $requestNameRegistrationBody
118-
119-
echo "> 2.Registration of request name succeeded."
120-
121-
echo "Publishing the symbols ..."
122-
$publishSymbolsBody = "{'publishToInternalServer': $publishToInternalServer, 'publishToPublicServer': $publishToPublicServer}"
123-
echo "Publishing symbols request body: $publishSymbolsBody"
124-
Invoke-RestMethod -Method POST -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests/$requestName" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json" -Body $publishSymbolsBody
125-
126-
echo "> 3.Request to publish symbols succeeded."
127-
128-
# The following REST calls are used to check publishing status.
129-
echo "> 4.Checking the status of the request ..."
130-
131-
Invoke-RestMethod -Method GET -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests/$requestName" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json"
132-
133-
echo "Use below tables to interpret the values of xxxServerStatus and xxxServerResult fields from the response."
134-
135-
echo "PublishingStatus"
136-
echo "-----------------"
137-
echo "0 NotRequested; The request has not been requested to publish."
138-
echo "1 Submitted; The request is submitted to be published"
139-
echo "2 Processing; The request is still being processed"
140-
echo "3 Completed; The request has been completed processing. It can be failed or successful. Check PublishingResult to get more details"
141-
142-
echo "PublishingResult"
143-
echo "-----------------"
144-
echo "0 Pending; The request has not completed or has not been requested."
145-
echo "1 Succeeded; The request has published successfully"
146-
echo "2 Failed; The request has failed to publish"
147-
echo "3 Cancelled; The request was cancelled"
13+
# SDL should have been performed before release. Disabling SDL in release pipeline. Note that some static analysis can't be disabled by default.
14+
# More info at https://eng.ms/docs/cloud-ai-platform/azure-edge-platform-aep/aep-engineering-systems/productivity-and-experiences/onebranch-platform-services/onebranch/securitycompliancegovernanceandpolicies/sdlforcontainerizedworkflows.
15+
globalSdl:
16+
baseline:
17+
baselineFile: $(Build.SourcesDirectory)\.gdn\.gdnbaselines
18+
suppressionSet: default
19+
suppression:
20+
suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress
21+
suppressionSet: default
22+
asyncSdl:
23+
enabled: false
24+
tsa:
25+
enabled: false
26+
credscan:
27+
enabled: false
28+
apiscan:
29+
enabled: false
30+
codeql:
31+
compiled:
32+
enabled: false
33+
binskim:
34+
enabled: false
35+
policheck:
36+
enabled: false
37+
eslint:
38+
enabled: false
39+
tsaOptionsFile: .config/tsaoptions.json
40+
41+
stages:
42+
- stage: PublishSymbols
43+
displayName: 'Publish Symbols'
44+
jobs:
45+
- job: PublishSymbols
46+
# Use the latest Windows image for building
47+
pool:
48+
vmImage: 'windows-latest'
49+
displayName: 'Publish Symbols - Windows'
50+
# Strategy matrix to build all combinations
51+
52+
steps:
53+
- task: UsePythonVersion@0
54+
inputs:
55+
versionSpec: '3.13'
56+
architecture: 'x64'
57+
addToPath: true
58+
displayName: 'Use Python 3.13'
59+
60+
# Install required packages: pip, CMake, pybind11
61+
- script: |
62+
python -m pip install --upgrade pip
63+
pip install -r requirements.txt
64+
pip install cmake pybind11
65+
displayName: 'Install dependencies'
66+
67+
# Generate the symbols for the mssql-python package using build.bat
68+
- script: |
69+
echo "Generating symbols for mssql-python package..."
70+
cd mssql_python\pybind
71+
build.bat
72+
cd ..
73+
dir /s /b
74+
displayName: 'Generate symbols for mssql-python package'
75+
76+
# Copy the generated symbols to the staging folder for artifacts
77+
- task: CopyFiles@2
78+
inputs:
79+
SourceFolder: '$(Build.SourcesDirectory)\mssql_python'
80+
Contents: '**\*.pdb'
81+
TargetFolder: '$(Build.ArtifactStagingDirectory)\mssql-python-symbols'
82+
displayName: 'Copy symbols to staging folder'
83+
84+
# Publish the symbols (only pdbs) as an artifact
85+
- task: PublishBuildArtifacts@1
86+
displayName: 'Publish symbols as build artifact'
87+
inputs:
88+
PathtoPublish: '$(Build.ArtifactStagingDirectory)\mssql-python-symbols'
89+
ArtifactName: 'mssql-python-symbols'
90+
publishLocation: 'Container'
91+
92+
- powershell: 'Write-Host "##vso[task.setvariable variable=ArtifactServices.Symbol.AccountName;]SqlClientDrivers"'
93+
displayName: 'Update Symbol.AccountName with SqlClientDrivers'
94+
95+
- task: PublishSymbols@2
96+
displayName: 'Upload symbols to SqlClientDrivers org'
97+
inputs:
98+
SymbolsFolder: '$(Build.ArtifactStagingDirectory)\mssql-python-symbols'
99+
SearchPattern: '**/*.pdb'
100+
IndexSources: false
101+
SymbolServerType: TeamServices
102+
SymbolsMaximumWaitTime: 60
103+
SymbolExpirationInDays: 1825 # 5 years
104+
SymbolsProduct: mssql-python
105+
# Have kept the default version as the build ID, which is unique for each build
106+
# This will be used to identify the symbols in the symbol server
107+
SymbolsVersion: $(Build.BuildId)
108+
# Ensuring the symbols are uniquely identified
109+
# MDS uses symbolsArtifactName as mds_symbols_$(System.TeamProject)_$(Build.Repository.Name)_$(Build.SourceBranchName)_$(NuGetPackageVersion)_$(System.TimelineId)
110+
SymbolsArtifactName: $(System.TeamProject)-$(Build.SourceBranchName)-$(Build.DefinitionName)-$(Build.BuildId)
111+
Pat: $(System.AccessToken)
112+
113+
- task: AzureCLI@2
114+
displayName: 'Publish symbols'
115+
env:
116+
SymbolServer: '$(SymbolServer)'
117+
SymbolTokenUri: '$(SymbolTokenUri)'
118+
requestName: '$(System.TeamProject)-$(Build.SourceBranchName)-$(Build.DefinitionName)-$(Build.BuildId)'
119+
inputs:
120+
azureSubscription: 'SymbolsPublishing-msodbcsql-mssql-python'
121+
scriptType: ps
122+
scriptLocation: inlineScript
123+
inlineScript: |
124+
# Should be true by default for internal server
125+
$publishToInternalServer = $true
126+
$publishToPublicServer = $false
127+
128+
echo "Publishing request name: $requestName"
129+
echo "Publish to internal server: $publishToInternalServer"
130+
echo "Publish to public server: $publishToPublicServer"
131+
132+
$symbolServer = '$(SymbolServer)'
133+
$tokenUri = '$(SymbolTokenUri)'
134+
$projectName = "mssql-python"
135+
136+
# Get the access token for the symbol publishing service
137+
$symbolPublishingToken = az account get-access-token --resource $tokenUri --query accessToken -o tsv
138+
139+
echo "> 1.Symbol publishing token acquired."
140+
141+
echo "Registering the request name ..."
142+
$requestName = '$(requestName)'
143+
$requestNameRegistrationBody = "{'requestName': '$requestName'}"
144+
Invoke-RestMethod -Method POST -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json" -Body $requestNameRegistrationBody
145+
146+
echo "> 2.Registration of request name succeeded."
147+
148+
echo "Publishing the symbols ..."
149+
$publishSymbolsBody = "{'publishToInternalServer': $publishToInternalServer, 'publishToPublicServer': $publishToPublicServer}"
150+
echo "Publishing symbols request body: $publishSymbolsBody"
151+
Invoke-RestMethod -Method POST -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests/$requestName" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json" -Body $publishSymbolsBody
152+
153+
echo "> 3.Request to publish symbols succeeded."
154+
155+
# The following REST calls are used to check publishing status.
156+
echo "> 4.Checking the status of the request ..."
157+
158+
Invoke-RestMethod -Method GET -Uri "https://$symbolServer.trafficmanager.net/projects/$projectName/requests/$requestName" -Headers @{ Authorization = "Bearer $symbolPublishingToken" } -ContentType "application/json"
159+
160+
echo "Use below tables to interpret the values of xxxServerStatus and xxxServerResult fields from the response."
161+
162+
echo "PublishingStatus"
163+
echo "-----------------"
164+
echo "0 NotRequested; The request has not been requested to publish."
165+
echo "1 Submitted; The request is submitted to be published"
166+
echo "2 Processing; The request is still being processed"
167+
echo "3 Completed; The request has been completed processing. It can be failed or successful. Check PublishingResult to get more details"
168+
169+
echo "PublishingResult"
170+
echo "-----------------"
171+
echo "0 Pending; The request has not completed or has not been requested."
172+
echo "1 Succeeded; The request has published successfully"
173+
echo "2 Failed; The request has failed to publish"
174+
echo "3 Cancelled; The request was cancelled"
148175
149176
# - job: ReleaseESRPPackage
150177
# displayName: 'Release ESRP Package'

0 commit comments

Comments
 (0)