Skip to content

Commit

Permalink
Merge branch 'main' into wendi
Browse files Browse the repository at this point in the history
  • Loading branch information
wonwuakpa-msft authored Oct 3, 2024
2 parents 246bb16 + 30600bc commit bcdf774
Showing 1 changed file with 136 additions and 6 deletions.
142 changes: 136 additions & 6 deletions release-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,14 @@ stages:
GOOS: windows
CGO_ENABLED: 0
- script: |
go build -tags "se_integration" -o "$(Build.ArtifactStagingDirectory)\azcopy_windows_se_arm64.exe"
displayName: 'Generate Windows ARM'
env:
GOARCH: arm64
GOOS: windows
CGO_ENABLED: 0
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'azCopy-windows-temp'
Expand Down Expand Up @@ -635,7 +643,7 @@ stages:
- ImageOverride -equals $(AgentName)

variables:
- group: AZCOPY_ESRP_SECRET
- group: AZCOPY_SECRET_VAULT

steps:
- checkout: none
Expand Down Expand Up @@ -726,7 +734,7 @@ stages:
- ImageOverride -equals $(AgentName)

variables:
- group: AZCOPY_ESRP_SECRET
- group: AZCOPY_SECRET_VAULT
- name: work_dir
value: '$(System.DefaultWorkingDirectory)/azure-storage-azcopy'
- name: archives
Expand Down Expand Up @@ -818,11 +826,15 @@ stages:
windows_arm64="$(work_dir)/azcopy_windows_arm64_$(azcopy_version)"
echo "##vso[task.setvariable variable=windows_arm64]$windows_arm64"
windows_se_arm64="$(work_dir)/azcopy_windows_se_arm64_$(azcopy_version)"
echo "##vso[task.setvariable variable=windows_se_arm64]$windows_se_arm64"
windows_386="$(work_dir)/azcopy_windows_386_$(azcopy_version)"
echo "##vso[task.setvariable variable=windows_386]$windows_386"
mkdir -p $windows_amd64
mkdir -p $windows_arm64
mkdir -p $windows_se_arm64
mkdir -p $windows_386
mkdir -p $(archives)
displayName: 'Create required directories'
Expand All @@ -831,12 +843,15 @@ stages:
mv $(Build.ArtifactStagingDirectory)/azCopy-windows-temp/azcopy_windows_amd64.exe $(windows_amd64)/azcopy.exe
mv $(Build.ArtifactStagingDirectory)/azCopy-windows-temp/azcopy_windows_arm64.exe $(windows_arm64)/azcopy.exe
mv $(Build.ArtifactStagingDirectory)/azCopy-windows-temp/azcopy_windows_386.exe $(windows_386)/azcopy.exe
mv $(Build.ArtifactStagingDirectory)/azCopy-windows-temp/azcopy_windows_se_arm64.exe $(windows_se_arm64)/azcopy.exe
cp NOTICE.txt $(windows_amd64)
cp NOTICE.txt $(windows_arm64)
cp NOTICE.txt $(windows_386)
cp NOTICE.txt $(windows_se_arm64)
zip -r $(archives)/azcopy_windows_amd64_$(azcopy_version).zip .
zip -r $(archives)/azcopy_windows_arm64_$(azcopy_version).zip .
zip -r $(archives)/azcopy_windows_386_$(azcopy_version).zip .
zip -r $(archives)/azcopy_windows_se_arm64_$(azcopy_version).zip .
displayName: 'Copy required files'
- task: ArchiveFiles@2
Expand All @@ -860,6 +875,13 @@ stages:
archiveFile: '$(archives)/azcopy_windows_386_$(azcopy_version).zip'
continueOnError: true

- task: ArchiveFiles@2
displayName: 'Archive Windows SE 64 bit ARM Build'
inputs:
rootFolderOrFile: '$(windows_se_arm64)'
archiveFile: '$(archives)/azcopy_windows_se_arm64_$(azcopy_version).zip'
continueOnError: true

- script: |
cp $(archives)/azcopy_windows* $(Build.ArtifactStagingDirectory)
displayName: 'Copy zip to staging directory'
Expand Down Expand Up @@ -890,7 +912,7 @@ stages:
- ImageOverride -equals $(AgentName)

variables:
- group: AZCOPY_ESRP_SECRET
- group: AZCOPY_SECRET_VAULT

steps:
- checkout: none
Expand Down Expand Up @@ -1628,8 +1650,7 @@ stages:
}
}
displayName: 'Extract Files and Run Version and Help Command on Windows'
# TestArtifacts ends here


- job: Set_10
timeoutInMinutes: 120
strategy:
Expand Down Expand Up @@ -1669,6 +1690,115 @@ stages:
azcopy --help
displayName: 'Check Version and Help'
- job: Set_11
timeoutInMinutes: 120
strategy:
matrix:
Windows-ARM64:
agentName: "windows_arm64"
pool:
name: "azcopy_windows_arm"
demands:
- ImageOverride -equals $(AgentName)

variables:
- name: root_dir
value: '$(System.DefaultWorkingDirectory)'

steps:
- task: GoTool@0
env:
GO111MODULE: 'on'
inputs:
version: $(AZCOPY_GOLANG_VERSION)

- script: |
echo 'Running GO Vet'
go vet
displayName: 'Golang Vet - Windows'
workingDirectory: $(root_dir)
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
artifactName: 'azCopy-windows-signed'
downloadPath: $(Build.ArtifactStagingDirectory)
itemPattern: azCopy-windows-signed/azcopy_windows_se_arm64*.zip

- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
$artifactDir = "$(Build.ArtifactStagingDirectory)\azCopy-windows-signed"
$extractDir = "$(Build.ArtifactStagingDirectory)\extracted"
# Find the zip file matching the pattern
$zipFile = Get-ChildItem -Path $artifactDir -Filter "azcopy*se_arm64*.zip" | Select-Object -First 1
if ($null -eq $zipFile) {
Write-Error "No zip file found matching pattern 'azcopy*se_arm64*.zip' in directory: $artifactDir"
exit 1
}
$zipFilePath = $zipFile.FullName
# Create extraction directory
New-Item -ItemType Directory -Path $extractDir -Force | Out-Null
# Extract the zip file
try {
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipFilePath, $extractDir)
} catch {
Write-Error "Failed to extract zip file: $_"
exit 1
}
# Change to the directory containing azcopy
Set-Location -Path $extractDir
# Find directories matching the pattern
$matchingDirs = Get-ChildItem -Directory -Path .\azcopy_windows_se_arm64* | Select-Object -First 1
# Check if there is exactly one matching directory
if ($matchingDirs.Count -eq 0) {
Write-Error "No directories found matching the pattern: .\azcopy_windows_se_arm64*"
exit 1
} elseif ($matchingDirs.Count -gt 1) {
Write-Error "Multiple directories found matching the pattern: .\azcopy_windows_se_arm64*"
exit 1
}
# Check if the azcopy executable exists in the matching directory
$azcopyPath = Join-Path -Path $matchingDirs.FullName -ChildPath "azcopy.exe"
if (-Not (Test-Path -Path $azcopyPath)) {
Write-Error "azcopy not found in extraction directory: $($matchingDirs.FullName)"
exit 1
} else {
Write-Output "azcopy found in extraction directory: $($matchingDirs.FullName)"
# Ensure the azcopy executable has the correct permissions
icacls $azcopyPath
# Run azcopy --version and capture output
try {
$versionOutput = & $azcopyPath --version 2>&1
Write-Output "azcopy version output: $versionOutput"
} catch {
Write-Error "Failed to run azcopy --version: $_"
}
# Run azcopy --help and capture output
try {
$helpOutput = & $azcopyPath --help 2>&1
Write-Output "azcopy help output: $helpOutput"
} catch {
Write-Error "Failed to run azcopy --help: $_"
}
}
displayName: 'Extract Files and Run Version and Help Command on Windows Arm64'

# TestArtifacts ends here

- stage: ReleaseToContainer
dependsOn: TestArtifacts
condition: succeeded('TestArtifacts')
Expand Down Expand Up @@ -1839,7 +1969,7 @@ stages:
pool:
vmImage: 'ubuntu-22.04'
variables:
- group: AZCOPY_ESRP_SECRET
- group: AZCOPY_SECRET_VAULT
- name: root_dir
value: '$(System.DefaultWorkingDirectory)'

Expand Down

0 comments on commit bcdf774

Please sign in to comment.