-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30515b0
commit 135fd03
Showing
1 changed file
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
# 'Allow scripts to access the OAuth token' was selected in pipeline. Add the following YAML to any steps requiring access: | ||
# env: | ||
# MY_ACCESS_TOKEN: $(System.AccessToken) | ||
# Variable 'runCodesignValidationInjection' was defined in the Variables tab | ||
# Variable 'policy_service.build_task_injection.enabled' was defined in the Variables tab | ||
# Variable 'PipelineGovernanceStatus_Audited' was defined in the Variables tab | ||
# Variable 'PipelineClassification_Audited' was defined in the Variables tab | ||
# Variable '1espt.codesignvalidation.enforced' was defined in the Variables tab | ||
# Cron Schedules have been converted using UTC Time Zone and may need to be updated for your location | ||
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 | ||
jobs: | ||
- job: Phase_1 | ||
displayName: Phase 1 | ||
cancelTimeoutInMinutes: 1 | ||
pool: | ||
name: Hosted VS2017 | ||
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 . | ||
... |