Skip to content

Commit

Permalink
Merge pull request #2336 from corbob/add-azcopy10
Browse files Browse the repository at this point in the history
(azcopy10) Migrate package to new repository
  • Loading branch information
pauby authored Dec 21, 2023
2 parents 5ab0385 + ba55c0b commit d68de88
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
*/nexus-repository* @chocolatey-community/chocolatey-team-maintainers
*/totalcommander* @pauby
*/kubescape* @HollowMan6
*/azcopy10* @chocolatey-community/chocolatey-team-maintainers

# Other
# This can be any file other that won't be matched as a package
Expand Down
27 changes: 27 additions & 0 deletions automatic/azcopy10/azcopy10.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>azcopy10</id>
<version>10.21.1</version>
<title>azcopy10</title>
<authors>Microsoft</authors>
<owners>chocolatey-community</owners>
<projectUrl>https://github.com/Azure/azure-storage-azcopy</projectUrl>
<packageSourceUrl>https://github.com/chocolatey-community/chocolatey-packages/tree/master/automatic/azcopy10</packageSourceUrl>
<iconUrl>https://cdn.jsdelivr.net/gh/chocolatey-community/chocolatey-packages@de115ff0e16d124c2099b8f95bd08bb92b6e4918/icons/azcopy10.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>https://raw.githubusercontent.com/Azure/azure-storage-azcopy/master/LICENSE</licenseUrl>
<docsUrl>https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10</docsUrl>
<tags>azcopy azure admin cli</tags>
<summary>AzCopy is the command-line utility for copying data to or from Microsoft Azure Blob and File storage.</summary>
<description><![CDATA[AzCopy **(v10)** is the **new** command-line utility designed for high-performance uploading, downloading, and copying data to and from Microsoft Azure Blob and File.
It has a whole new syntax incompatible with the old v8 versions. You can use them side-by-side.
Now packaged as a single exe file with simple commands designed for optimal performance. You can copy data between a file system and a storage account, or between storage accounts.
]]></description>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
25 changes: 25 additions & 0 deletions automatic/azcopy10/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
$ErrorActionPreference = 'Stop';

$packageName = 'azcopy10'
$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition

$packageArgs = @{
packageName = $packageName
url64 = 'https://azcopyvnext.azureedge.net/releases/release-10.21.1-20231025/azcopy_windows_amd64_10.21.1.zip'
checksum64 = '12927c211b3da7ea0df28277d4a69ff7a6046cd8ad3163b40fc2b31a96d66e81'
checksumType64 = 'sha256'
url = 'https://azcopyvnext.azureedge.net/releases/release-10.21.1-20231025/azcopy_windows_386_10.21.1.zip'
checksum = '461990141b1ff495a2cf25f2809169c541bd53364ce32fc43b912f4c664b9a23'
checksumType = 'sha256'
destination = $toolsDir
}

#Manage azcopy installation
Install-ChocolateyZipPackage @packageArgs

$targetPath = Join-Path -Path $toolsDir -ChildPath 'azcopy'
If (Test-Path -Path $targetPath -PathType:Container) {
Remove-Item -Path $targetPath -Force -Recurse
}

Get-ChildItem -Path $toolsDir -Directory -Filter "azcopy*" | Rename-Item -NewName 'azcopy' -Force
32 changes: 32 additions & 0 deletions automatic/azcopy10/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import-module au

$releases = 'https://aka.ms/downloadazcopy-v10-windows'

function global:au_SearchReplace {
@{
".\tools\chocolateyInstall.ps1" = @{
"(?i)(^\s*url64\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'"
"(?i)(^\s*checksum64\s*=\s*)('.*')" = "`$1'$($Latest.Checksum64)'"
"(?i)(^\s*checksumType64\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType64)'"
"(?i)(^\s*url\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'"
"(?i)(^\s*checksum\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
"(?i)(^\s*checksumType\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType32)'"
}
}
}

function global:au_GetLatest {
$download_page = Invoke-WebRequest -Uri $releases -MaximumRedirection 0 -ErrorAction SilentlyContinue

$url64 = $download_page.Headers.Location
$url32 = $url64 -replace "amd64", "386"
$version = $url64 -replace ".zip", "" -split "_" | Select-Object -Last 1

@{
URL32 = $url32
URL64 = $url64
Version = $version
}
}

update -ChecksumFor all
Binary file added icons/azcopy10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d68de88

Please sign in to comment.