diff --git a/windowspkg/linkerd2-cli/linkerd2-cli.nuspec b/windowspkg/linkerd2-cli/linkerd2-cli.nuspec new file mode 100644 index 0000000000000..9dae078566005 --- /dev/null +++ b/windowspkg/linkerd2-cli/linkerd2-cli.nuspec @@ -0,0 +1,20 @@ + + + + linkerd2-cli + 2.6.1 + + linkerd2-cli (Install) + __REPLACE_AUTHORS_OF_SOFTWARE_COMMA_SEPARATED__ + linkerd2-cli SPACE_SEPARATED + __REPLACE__ + __REPLACE__MarkDown_Okay + + + + + + + + + \ No newline at end of file diff --git a/windowspkg/linkerd2-cli/tools/LICENSE.txt b/windowspkg/linkerd2-cli/tools/LICENSE.txt new file mode 100644 index 0000000000000..0333b2c4cd926 --- /dev/null +++ b/windowspkg/linkerd2-cli/tools/LICENSE.txt @@ -0,0 +1,11 @@ + +Note: Include this file if including binaries you have the right to distribute. +Otherwise delete. this file. + +===DELETE ABOVE THIS LINE AND THIS LINE=== + +From: + +LICENSE + + diff --git a/windowspkg/linkerd2-cli/tools/VERIFICATION.txt b/windowspkg/linkerd2-cli/tools/VERIFICATION.txt new file mode 100644 index 0000000000000..775ebe7311da4 --- /dev/null +++ b/windowspkg/linkerd2-cli/tools/VERIFICATION.txt @@ -0,0 +1,13 @@ + +Note: Include this file if including binaries you have the right to distribute. +Otherwise delete. this file. If you are the software author, you can change this +mention you are the author of the software. + +===DELETE ABOVE THIS LINE AND THIS LINE=== + +VERIFICATION +Verification is intended to assist the Chocolatey moderators and community +in verifying that this package's contents are trustworthy. + + + \ No newline at end of file diff --git a/windowspkg/linkerd2-cli/tools/chocolateyinstall.ps1 b/windowspkg/linkerd2-cli/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000000000..ad8a547731f90 --- /dev/null +++ b/windowspkg/linkerd2-cli/tools/chocolateyinstall.ps1 @@ -0,0 +1,14 @@ +$ErrorActionPreference = 'Stop'; +$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" + +$packageArgs = @{ + + packageName = 'linkerd' + fileFullPath = "$toolsPath\linkerd.exe" + url = 'https://github.com/linkerd/linkerd2/releases/download/stable-2.6.1/linkerd2-cli-stable-2.6.1-windows.exe' + checksum = '4ed915b10c2a76070d40bf3223f09e742777105914acaeadfc83d99ef6cf1798' + checksumType = 'sha256' +} + +Get-ChocolateyWebFile @packageArgs +Install-ChocolateyPath $packageArgs.fileFullPath 'Machine' \ No newline at end of file diff --git a/windowspkg/linkerd2-cli/update.ps1 b/windowspkg/linkerd2-cli/update.ps1 new file mode 100644 index 0000000000000..c271d3b7c56c5 --- /dev/null +++ b/windowspkg/linkerd2-cli/update.ps1 @@ -0,0 +1,43 @@ +[CmdletBinding()] +param([switch] $Force) +Import-Module AU + +$domain = "https://github.com" +$releases = "$domain/linkerd/linkerd2/releases" + +function global:au_BeforeUpdate { + + Get-RemoteFiles -Purge -NoSuffix -FileNameBase "linkerd2-cli" + $Latest.Checksum64 = Get-RemoteChecksum $Latest.Url + +} + +function global:au_SearchReplace { + + @{ + ".\tools\chocolateyInstall.ps1" = @{ + + "(?i)(^\s*packageName\s*=\s*)('.*')" = "`$1'$($Latest.PackageName)'" + "(?i)(^\s*url\s*=\s*)" = "`$1'$($Latest.URL)'" + "(?i)(^\s*checksum\s*=\s*)" = "`$1'$($Latest.Checksum64)'" + + } + } +} + +function global:au_GetLatest { + + $download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing + $url = $download_page.links | ? href -match '/linkerd2-cli-stable-(.+)-windows\.exe$' | % href | select -First 1 + $url = $domain+$url + $version = $Matches[1] + return @{ + + Version = $version + URL = $url + ReleaseURL = "$domain/linkerd/linkerd2/releases/tag/v${version}" + + } + +} +update -ChecksumFor none -Force:$Force \ No newline at end of file