From 135fd03158f6e197c5cc0c26ab8143a62fdc6e68 Mon Sep 17 00:00:00 2001 From: apudovkin-ms Date: Fri, 13 Sep 2024 12:40:55 +0200 Subject: [PATCH] Create azure-pipelines.yml --- azure-pipelines.yml | 145 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..eed1e721 --- /dev/null +++ b/azure-pipelines.yml @@ -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 . +...