Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create azure-pipelines.yml #506

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 .
...
Loading