Skip to content

Commit

Permalink
Merge pull request #506 from microsoft/users/apudovkin/CreateAzDOYAML…
Browse files Browse the repository at this point in the history
…Pipeline

Create azure-pipelines.yml
  • Loading branch information
apudovkin-ms authored Sep 13, 2024
2 parents 30515b0 + 135fd03 commit 6c778b5
Showing 1 changed file with 145 additions and 0 deletions.
145 changes: 145 additions & 0 deletions azure-pipelines.yml
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 .
...

0 comments on commit 6c778b5

Please sign in to comment.