Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
bd40107
Update azure-pipelines.yml for Azure Pipelines
YanaXu Oct 10, 2025
5c114ad
Add argument parsing for RPM installation
YanaXu Oct 11, 2025
3cf4742
Add Azure pipeline for RPM and Docker image builds
YanaXu Oct 11, 2025
662a5d4
Revert Change to default Azure CLI Pipeline
YanaXu Oct 11, 2025
4581498
Update docker run commands to use -c option
YanaXu Oct 11, 2025
e7654a2
Fix script invocation in Azure Pipelines YAML
YanaXu Oct 11, 2025
152bfe0
Fix docker run command by removing unnecessary option
YanaXu Oct 11, 2025
b71e01b
Set timeout for TestDockerImageAzureLinux job
YanaXu Oct 13, 2025
28fb3b3
add a new job to use copa
YanaXu Oct 13, 2025
7c9639f
fix paramter format
YanaXu Oct 13, 2025
e7d2649
change arm64 agent pool
YanaXu Oct 13, 2025
00106a4
print go version
YanaXu Oct 13, 2025
7644dd6
install copa
YanaXu Oct 15, 2025
00a029d
fix variable
YanaXu Oct 15, 2025
e51480a
update get az cli version logic
YanaXu Oct 17, 2025
4b85a97
print all env
YanaXu Oct 17, 2025
819fc64
try not checkout the whole repo
YanaXu Oct 17, 2025
001741b
add debug log
YanaXu Oct 17, 2025
785c542
update url
YanaXu Oct 17, 2025
281efc9
replace get az version job to save time
YanaXu Oct 17, 2025
761b00b
refactor variables
YanaXu Oct 17, 2025
e45bb4a
add test
YanaXu Oct 17, 2025
8339425
use stage to refactor pipeline
YanaXu Oct 17, 2025
ac27568
add smoke test
YanaXu Oct 17, 2025
072fc93
add lines
YanaXu Oct 17, 2025
093cab6
install pwsh for smoke test
YanaXu Oct 20, 2025
4f90158
extract templates
YanaXu Oct 20, 2025
2f20ad6
fix a bug
YanaXu Oct 20, 2025
3b8ca4b
fix a bug 2
YanaXu Oct 20, 2025
791c459
update variable
YanaXu Oct 20, 2025
a114327
refactor test
YanaXu Oct 20, 2025
58032e1
format
YanaXu Oct 20, 2025
6dab440
remove not used jobs
YanaXu Oct 20, 2025
97f824b
revert
YanaXu Oct 20, 2025
c350614
format
YanaXu Oct 20, 2025
e952c8c
remove powershell usage
YanaXu Oct 21, 2025
4ab5b53
format
YanaXu Oct 21, 2025
64717f1
fix variable
YanaXu Oct 21, 2025
672aa97
fix smoke test
YanaXu Oct 21, 2025
2727748
workaround unit test
YanaXu Oct 21, 2025
2aecff3
fix folder
YanaXu Oct 21, 2025
ececaf1
switch the steps
YanaXu Oct 22, 2025
8cfeded
update display name
YanaXu Oct 22, 2025
82d0d63
update artifact folder
YanaXu Oct 22, 2025
a5557e4
workaround unit test
YanaXu Oct 22, 2025
2fbfcca
fix artifact folder
YanaXu Oct 22, 2025
4a5f42b
yml format
YanaXu Oct 23, 2025
2255852
remove not used condition
YanaXu Oct 23, 2025
e37d124
refine
YanaXu Oct 23, 2025
4de6f75
update shouldTest as default true
YanaXu Oct 23, 2025
94f4886
merge tasks
YanaXu Oct 23, 2025
591f56a
support no patchable vulnerabilities found
YanaXu Oct 30, 2025
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
96 changes: 96 additions & 0 deletions .azure-pipelines/templates/test-docker-image-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
parameters:
- name: architectures
type: object
- name: downloadArtifactNameSuffix
type: string
default: ''
- name: ShouldTest
type: boolean
default: false
- name: timeoutInMinutes
type: number
default: 100
- name: AzCliVersion
type: string
default: ''
- name: AzCliImageName
type: string
default: ''
- name: AzCliImageTag
type: string
default: ''
- name: TestAzUserId
type: string
default: ''
- name: TestAzSubscription
type: string
default: ''
- name: TestAzTenant
type: string
default: ''
- name: TestServiceConnectionId
type: string
default: ''

jobs:
- job: TestDockerImageSmokeTest
displayName: Smoke Test - Docker
condition: and(succeeded(), eq(${{parameters.ShouldTest}}, true))
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
strategy:
matrix:
${{ each arch in parameters.architectures }}:
${{ arch.name }}:
pool: ${{ arch.pool }}
downloadArtifactName: ${{ parameters.AzCliVersion }}-docker-${{ arch.value }}${{ parameters.downloadArtifactNameSuffix }}
uploadArtifactName: ${{ parameters.AzCliVersion }}-docker-${{ arch.value }}-smoke-test${{ parameters.downloadArtifactNameSuffix }}
architecture: ${{ arch.value }}
pool:
name: $(pool)
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Docker Image'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/docker'
artifactName: $(downloadArtifactName)

- bash: ./scripts/ci/install_docker.sh
displayName: Install Docker

- task: Bash@3
displayName: 🚀 Self Test
inputs:
targetType: 'inline'
script: |
echo "== Load docker image =="
TAR_FILE="$SYSTEM_ARTIFACTSDIRECTORY/docker/docker-azure-cli-${{ parameters.AzCliVersion }}.tar"
docker load < $TAR_FILE

echo "== Docker Images =="
docker images

echo "== Run az self-test =="
docker run ${{ parameters.AzCliImageName }}:${{ parameters.AzCliImageTag }} /bin/bash -c "time az self-test && time az --version && tdnf list --installed"

- task: Bash@3
displayName: 🚀🚀 Smoke Test
inputs:
targetType: 'inline'
script: |
scUrl="${SYSTEM_OIDCREQUESTURI}?api-version=7.1&serviceConnectionId=${{parameters.TestServiceConnectionId}}"
response=$(curl -s -X POST "$scUrl" -H "Authorization: Bearer $(System.AccessToken)" -H "Content-Type: application/json" -d '')
OidcToken=$(echo "$response" | jq -r '.oidcToken')

chmod +x ./scripts/release/docker/test_az_cli_in_pipeline.sh
docker run -v $(System.DefaultWorkingDirectory)/scripts/release/docker:/test ${{ parameters.AzCliImageName }}:${{ parameters.AzCliImageTag }} /bin/bash -c "az login --service-principal --username ${{parameters.TestAzUserId}} --tenant ${{parameters.TestAzTenant}} --federated-token $OidcToken && az account set --subscription ${{parameters.TestAzSubscription}} && /test/test_az_cli_in_pipeline.sh"

echo "--------------------------------------------"

mkdir output
mv $(System.DefaultWorkingDirectory)/scripts/release/docker/azure_cli_test_output.log $(System.DefaultWorkingDirectory)/output/azure_cli_test_output.log
mv $(System.DefaultWorkingDirectory)/scripts/release/docker/azure_cli_test_result.csv $(System.DefaultWorkingDirectory)/output/azure_cli_test_result.csv
ls $(System.DefaultWorkingDirectory)/output

- publish: $(System.DefaultWorkingDirectory)/output
artifact: $(uploadArtifactName)
displayName: Publish Test Artifact
66 changes: 66 additions & 0 deletions .azure-pipelines/templates/test-docker-image-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
parameters:
- name: architectures
type: object
- name: downloadArtifactNamePrefix
type: string
default: 'docker-azurelinux3.0'
- name: downloadArtifactNameSuffix
type: string
default: ''
- name: ShouldTest
type: boolean
default: false
- name: timeoutInMinutes
type: number
default: 180
- name: AzCliVersion
type: string
default: ''
- name: AzCliImageName
type: string
default: ''
- name: AzCliImageTag
type: string
default: ''

jobs:
- job: TestDockerImageUnitTest
displayName: Unit Test - Docker
condition: and(succeeded(), eq(${{parameters.ShouldTest}}, true))
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
strategy:
matrix:
${{ each arch in parameters.architectures }}:
${{ arch.name }}:
pool: ${{ arch.pool }}
downloadArtifactName: ${{ parameters.AzCliVersion }}-docker-${{ arch.value }}${{ parameters.downloadArtifactNameSuffix }}
pool:
name: $(pool)
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Docker Image'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/docker'
artifactName: $(downloadArtifactName)

- bash: ./scripts/ci/install_docker.sh
displayName: Install Docker

- bash: |
set -exv

echo "== Load docker image =="
TAR_FILE="$SYSTEM_ARTIFACTSDIRECTORY/docker/docker-azure-cli-${{ parameters.AzCliVersion }}.tar"
docker load < $TAR_FILE

echo "== Run az self-test =="
docker run ${{ parameters.AzCliImageName }}:${{ parameters.AzCliImageTag }} /bin/bash -c "time az self-test && time az --version && tdnf list --installed"
displayName: '🚀 Self Test'

- bash: |
echo "== List docker image =="
docker images

echo "== Run unit test =="
docker run --rm -v $(pwd):/azure-cli ${{ parameters.AzCliImageName }}:${{ parameters.AzCliImageTag }} /bin/bash /azure-cli/scripts/release/rpm/test_azurelinux_in_docker.sh --InstallRPM false
displayName: '🚀🚀 Unit Test'
Loading