Skip to content

Commit 135fd03

Browse files
authored
Create azure-pipelines.yml
1 parent 30515b0 commit 135fd03

File tree

1 file changed

+145
-0
lines changed

1 file changed

+145
-0
lines changed

azure-pipelines.yml

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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
10+
trigger:
11+
branches:
12+
include:
13+
- dev
14+
- master
15+
- releases/vsts
16+
batch: True
17+
schedules:
18+
- cron: 0 6 * * 1
19+
branches:
20+
include:
21+
- refs/heads/dev
22+
always: true
23+
resources:
24+
repositories:
25+
- repository: self
26+
type: git
27+
ref: refs/heads/dev
28+
jobs:
29+
- job: Phase_1
30+
displayName: Phase 1
31+
cancelTimeoutInMinutes: 1
32+
pool:
33+
name: Hosted VS2017
34+
steps:
35+
- checkout: self
36+
clean: true
37+
fetchTags: true
38+
persistCredentials: True
39+
- task: UsePythonVersion@0
40+
displayName: Use Python 3.x
41+
- task: PowerShell@2
42+
name: PowerShell4
43+
displayName: Create Virtual Environment
44+
inputs:
45+
targetType: inline
46+
script: >-
47+
.\scripts\windows\init.ps1
48+
49+
if ($LASTEXITCODE -ne 0) {
50+
Write-Host "##vso[task.logissue type=error;] init script failed."
51+
Exit $LASTEXITCODE
52+
}
53+
54+
55+
& python -m pip install -U pip setuptools
56+
- task: Bash@3
57+
name: ShellScript1
58+
displayName: Update Version
59+
inputs:
60+
filePath: scripts/ci/version.sh
61+
arguments: $(Build.BuildNumber)
62+
script: >
63+
#!/usr/bin/env bash
64+
65+
66+
# Update the version strings in the source code
67+
68+
69+
# Input:
70+
71+
# $1 - the version string, if omitted, use ${BUILD_BUILDID}
72+
73+
74+
version=$1
75+
76+
77+
if [ -z ${version} ]; then
78+
version=${BUILD_BUILDID}
79+
fi
80+
81+
82+
if [ -z ${version} ]; then
83+
echo 'Missing version string'
84+
exit 1
85+
fi
86+
87+
88+
echo "Add dev version suffix: $version"
89+
90+
91+
platform=`uname`
92+
93+
94+
echo "Platform: $platform"
95+
96+
97+
pattern="s/^VERSION = [\"']\(.*\)[\"']/VERSION = \"\1.dev$version\"/"
98+
99+
100+
if [ "${platform}" == "MSYS_NT-10.0" ]; then
101+
# On preview version of sh build task, the script will pick up the wrong version of find.exe
102+
find="C:\Program Files\Git\usr\bin\find.exe"
103+
else
104+
find="find"
105+
fi
106+
107+
108+
109+
for each in $("${find}" . -name setup.py); do
110+
if [ "$platform" == "Darwin" ]; then
111+
sed -i "" "${pattern}" "${each}"
112+
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
113+
else
114+
sed -i "${pattern}" "${each}"
115+
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
116+
fi
117+
done
118+
119+
120+
for each in $("${find}" . -name version.py); do
121+
if [ "$platform" == "Darwin" ]; then
122+
sed -i "" "${pattern}" "${each}"
123+
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
124+
else
125+
sed -i "${pattern}" "${each}"
126+
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
127+
fi
128+
done
129+
- task: PowerShell@2
130+
name: PowerShell1
131+
displayName: Compile All
132+
timeoutInMinutes: 1
133+
inputs:
134+
targetType: inline
135+
script: >-
136+
.\scripts\windows\init.ps1
137+
138+
if ($LASTEXITCODE -ne 0) {
139+
Write-Host "##vso[task.logissue type=error;] init script failed."
140+
Exit $LASTEXITCODE
141+
}
142+
143+
144+
& python -m compileall .
145+
...

0 commit comments

Comments
 (0)