Skip to content

Commit

Permalink
Add azcopy support for windows arm64 for storage
Browse files Browse the repository at this point in the history
  • Loading branch information
dphulkar-msft committed Oct 3, 2024
1 parent 8dd485d commit 766ba0e
Showing 1 changed file with 103 additions and 103 deletions.
206 changes: 103 additions & 103 deletions release-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1690,112 +1690,112 @@ 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)'
# - 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
# 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"
# - 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'
# # 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

Expand Down

0 comments on commit 766ba0e

Please sign in to comment.