Skip to content

Commit 0af04ae

Browse files
authored
Update azure-pipelines.yml
1 parent 148ce24 commit 0af04ae

File tree

1 file changed

+89
-128
lines changed

1 file changed

+89
-128
lines changed

azure-pipelines.yml

Lines changed: 89 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
# 'Allow scripts to access the OAuth token' was selected in pipeline. Add the following YAML to any steps requiring access:
2-
# env:
3-
# MY_ACCESS_TOKEN: $(System.AccessToken)
4-
# Variable 'runCodesignValidationInjection' was defined in the Variables tab
5-
# Variable 'policy_service.build_task_injection.enabled' was defined in the Variables tab
6-
# Variable 'PipelineGovernanceStatus_Audited' was defined in the Variables tab
7-
# Variable 'PipelineClassification_Audited' was defined in the Variables tab
8-
# Variable '1espt.codesignvalidation.enforced' was defined in the Variables tab
9-
# Cron Schedules have been converted using UTC Time Zone and may need to be updated for your location
1+
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
2+
# Please make sure to check all the converted content, it is your team's responsibility to make sure that the pipeline is still valid and functions as expected.
3+
# This pipeline will be extended to the MicroBuild template
104
trigger:
115
branches:
126
include:
@@ -25,122 +19,89 @@ resources:
2519
- repository: self
2620
type: git
2721
ref: refs/heads/dev
28-
jobs:
29-
- job: Phase_1
30-
displayName: Phase 1
31-
cancelTimeoutInMinutes: 1
32-
pool:
33-
name: Azure Pipelines
34-
vmImage: windows-2022
35-
steps:
36-
- checkout: self
37-
clean: true
38-
fetchTags: true
39-
persistCredentials: True
40-
- task: UsePythonVersion@0
41-
displayName: Use Python 3.x
42-
- task: PowerShell@2
43-
name: PowerShell4
44-
displayName: Create Virtual Environment
45-
inputs:
46-
targetType: inline
47-
script: >-
48-
.\scripts\windows\init.ps1
49-
50-
if ($LASTEXITCODE -ne 0) {
51-
Write-Host "##vso[task.logissue type=error;] init script failed."
52-
Exit $LASTEXITCODE
53-
}
54-
55-
56-
& python -m pip install -U pip setuptools
57-
- task: Bash@3
58-
name: ShellScript1
59-
displayName: Update Version
60-
inputs:
61-
filePath: scripts/ci/version.sh
62-
arguments: $(Build.BuildNumber)
63-
script: >
64-
#!/usr/bin/env bash
65-
66-
67-
# Update the version strings in the source code
68-
69-
70-
# Input:
71-
72-
# $1 - the version string, if omitted, use ${BUILD_BUILDID}
73-
74-
75-
version=$1
76-
77-
78-
if [ -z ${version} ]; then
79-
version=${BUILD_BUILDID}
80-
fi
81-
82-
83-
if [ -z ${version} ]; then
84-
echo 'Missing version string'
85-
exit 1
86-
fi
87-
88-
89-
echo "Add dev version suffix: $version"
90-
91-
92-
platform=`uname`
93-
94-
95-
echo "Platform: $platform"
96-
97-
98-
pattern="s/^VERSION = [\"']\(.*\)[\"']/VERSION = \"\1.dev$version\"/"
99-
100-
101-
if [ "${platform}" == "MSYS_NT-10.0" ]; then
102-
# On preview version of sh build task, the script will pick up the wrong version of find.exe
103-
find="C:\Program Files\Git\usr\bin\find.exe"
104-
else
105-
find="find"
106-
fi
107-
108-
109-
110-
for each in $("${find}" . -name setup.py); do
111-
if [ "$platform" == "Darwin" ]; then
112-
sed -i "" "${pattern}" "${each}"
113-
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
114-
else
115-
sed -i "${pattern}" "${each}"
116-
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
117-
fi
118-
done
119-
120-
121-
for each in $("${find}" . -name version.py); do
122-
if [ "$platform" == "Darwin" ]; then
123-
sed -i "" "${pattern}" "${each}"
124-
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
125-
else
126-
sed -i "${pattern}" "${each}"
127-
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
128-
fi
129-
done
130-
- task: PowerShell@2
131-
name: PowerShell1
132-
displayName: Compile All
133-
timeoutInMinutes: 1
134-
inputs:
135-
targetType: inline
136-
script: >-
137-
.\scripts\windows\init.ps1
138-
139-
if ($LASTEXITCODE -ne 0) {
140-
Write-Host "##vso[task.logissue type=error;] init script failed."
141-
Exit $LASTEXITCODE
142-
}
143-
144-
145-
& python -m compileall .
146-
...
22+
- repository: MicroBuildTemplate
23+
type: git
24+
name: 1ESPipelineTemplates/MicroBuildTemplate
25+
ref: refs/tags/release
26+
extends:
27+
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
28+
parameters:
29+
sdl:
30+
sourceAnalysisPool: <AgentPoolPlaceHolder>
31+
pool:
32+
name: AzurePipelines-EO
33+
image: AzurePipelinesWindows2022compliantGPT
34+
os: windows
35+
customBuildTags:
36+
- ES365AIMigrationTooling
37+
stages:
38+
- stage: stage
39+
jobs:
40+
- job: Phase_1
41+
displayName: Phase 1
42+
cancelTimeoutInMinutes: 1
43+
pool:
44+
name: Azure Pipelines
45+
vmImage: windows-2022
46+
steps:
47+
- checkout: self
48+
clean: true
49+
fetchTags: true
50+
persistCredentials: True
51+
- task: UsePythonVersion@0
52+
displayName: Use Python 3.x
53+
- task: PowerShell@2
54+
name: PowerShell4
55+
displayName: Create Virtual Environment
56+
inputs:
57+
targetType: inline
58+
script: >-
59+
.\scripts\windows\init.ps1 if ($LASTEXITCODE -ne 0) {
60+
Write-Host "##vso[task.logissue type=error;] init script failed."
61+
Exit $LASTEXITCODE
62+
} & python -m pip install -U pip setuptools
63+
- task: Bash@3
64+
name: ShellScript1
65+
displayName: Update Version
66+
inputs:
67+
filePath: scripts/ci/version.sh
68+
arguments: $(Build.BuildNumber)
69+
script: >
70+
#!/usr/bin/env bash # Update the version strings in the source code # Input: # $1 - the version string, if omitted, use ${BUILD_BUILDID} version=$1 if [ -z ${version} ]; then
71+
version=${BUILD_BUILDID}
72+
fi if [ -z ${version} ]; then
73+
echo 'Missing version string'
74+
exit 1
75+
fi echo "Add dev version suffix: $version" platform=`uname` echo "Platform: $platform" pattern="s/^VERSION = [\"']\(.*\)[\"']/VERSION = \"\1.dev$version\"/" if [ "${platform}" == "MSYS_NT-10.0" ]; then
76+
# On preview version of sh build task, the script will pick up the wrong version of find.exe
77+
find="C:\Program Files\Git\usr\bin\find.exe"
78+
else
79+
find="find"
80+
fi for each in $("${find}" . -name setup.py); do
81+
if [ "$platform" == "Darwin" ]; then
82+
sed -i "" "${pattern}" "${each}"
83+
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
84+
else
85+
sed -i "${pattern}" "${each}"
86+
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
87+
fi
88+
done for each in $("${find}" . -name version.py); do
89+
if [ "$platform" == "Darwin" ]; then
90+
sed -i "" "${pattern}" "${each}"
91+
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
92+
else
93+
sed -i "${pattern}" "${each}"
94+
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
95+
fi
96+
done
97+
- task: PowerShell@2
98+
name: PowerShell1
99+
displayName: Compile All
100+
timeoutInMinutes: 1
101+
inputs:
102+
targetType: inline
103+
script: >-
104+
.\scripts\windows\init.ps1 if ($LASTEXITCODE -ne 0) {
105+
Write-Host "##vso[task.logissue type=error;] init script failed."
106+
Exit $LASTEXITCODE
107+
} & python -m compileall .

0 commit comments

Comments
 (0)