-
Notifications
You must be signed in to change notification settings - Fork 200
/
azure-pipelines.yml
150 lines (121 loc) · 4.4 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
# 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.
# This pipeline will be extended to the MicroBuild template
trigger:
branches:
include:
- dev
- master
- releases/vsts
batch: True
schedules:
- cron: 0 6 * * 1
branches:
include:
- refs/heads/dev
always: true
resources:
repositories:
- repository: self
type: git
ref: refs/heads/dev
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
sdl:
sourceAnalysisPool: 1ESPtTfsAgentBuildPoolSDL
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-2022
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: stage
jobs:
- job: Phase_1
displayName: Phase 1
cancelTimeoutInMinutes: 1
pool:
name: 1ES-Shared-Hosted-Pool_Windows-Server-2022
steps:
- checkout: self
clean: true
fetchTags: true
persistCredentials: True
- task: UsePythonVersion@0
displayName: Use Python 3.x
- task: PowerShell@2
name: PowerShell4
displayName: Create Virtual Environment
inputs:
targetType: inline
script: >-
.\scripts\windows\init.ps1
if ($LASTEXITCODE -ne 0) {
Write-Host "##vso[task.logissue type=error;] init script failed."
Exit $LASTEXITCODE
}
& python -m pip install -U pip setuptools
- task: Bash@3
name: ShellScript1
displayName: Update Version
inputs:
filePath: scripts/ci/version.sh
arguments: $(Build.BuildNumber)
script: >
#!/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
version=${BUILD_BUILDID}
fi
if [ -z ${version} ]; then
echo 'Missing version string'
exit 1
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
# On preview version of sh build task, the script will pick up the wrong version of find.exe
find="C:\Program Files\Git\usr\bin\find.exe"
else
find="find"
fi
for each in $("${find}" . -name setup.py); do
if [ "$platform" == "Darwin" ]; then
sed -i "" "${pattern}" "${each}"
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
else
sed -i "${pattern}" "${each}"
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
fi
done
for each in $("${find}" . -name version.py); do
if [ "$platform" == "Darwin" ]; then
sed -i "" "${pattern}" "${each}"
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
else
sed -i "${pattern}" "${each}"
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
fi
done
- task: PowerShell@2
name: PowerShell1
displayName: Compile All
timeoutInMinutes: 1
inputs:
targetType: inline
script: >-
.\scripts\windows\init.ps1 if ($LASTEXITCODE -ne 0) {
Write-Host "##vso[task.logissue type=error;] init script failed."
Exit $LASTEXITCODE
} "&" python -m compileall .