Skip to content

Commit

Permalink
Update azure-pipelines.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
apudovkin-ms authored Sep 13, 2024
1 parent 148ce24 commit 0af04ae
Showing 1 changed file with 89 additions and 128 deletions.
217 changes: 89 additions & 128 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# '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
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
# Please make sure to check all the converted content, it is your team's responsibility to make sure that the pipeline is still valid and functions as expected.
# This pipeline will be extended to the MicroBuild template
trigger:
branches:
include:
Expand All @@ -25,122 +19,89 @@ resources:
- repository: self
type: git
ref: refs/heads/dev
jobs:
- job: Phase_1
displayName: Phase 1
cancelTimeoutInMinutes: 1
pool:
name: Azure Pipelines
vmImage: windows-2022
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 .
...
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
sdl:
sourceAnalysisPool: <AgentPoolPlaceHolder>
pool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: stage
jobs:
- job: Phase_1
displayName: Phase 1
cancelTimeoutInMinutes: 1
pool:
name: Azure Pipelines
vmImage: windows-2022
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 0af04ae

Please sign in to comment.