diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index c62280d02..8fda3d078 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -113,4 +113,6 @@ jobs: ! -name test-scale \ ! -name update-go-deps-shas \ ! -name web \ + ! -name *.nuspec \ + ! -name *.ps1 \ | xargs -I {} bin/shellcheck -x {} diff --git a/bin/win/linkerd.nuspec b/bin/win/linkerd.nuspec new file mode 100644 index 000000000..1cbc73963 --- /dev/null +++ b/bin/win/linkerd.nuspec @@ -0,0 +1,32 @@ + + + + linkerd + ${LINKERD_VERSION} + + Linkerd + Linkerd + Ultralight service mesh for Kubernetes and beyond + + Linkerd is an ultralight service mesh for Kubernetes. + It gives you observability, reliability, and security without requiring any code changes. + + Package Parameters + - `path`: Specify path for linkerd-cli installation. If not specified, uses environment variable `linkerdPath`. Uses default chocolatey install path if none provided. + - `checksum`: Specify the checksum for linkerd-cli. If not specified, uses environment variable `linkerdCheckSum`. Defaults to `null` if no checksum provided and skips verification. Do ensure to use the correct checksum for the version of install. + + + https://github.com/linkerd/linkerd2 + https://github.com/linkerd/linkerd2/blob/master/LICENSE + https://github.com/linkerd/linkerd2/releases + https://linkerd.io/docs + + + + + + + + + + \ No newline at end of file diff --git a/bin/win/tools/chocolateyinstall.ps1 b/bin/win/tools/chocolateyinstall.ps1 new file mode 100644 index 000000000..6c05e3924 --- /dev/null +++ b/bin/win/tools/chocolateyinstall.ps1 @@ -0,0 +1,33 @@ +$ErrorActionPreference = 'Stop'; +$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" + +$version = $env:chocolateyPackageVersion +$pp = Get-PackageParameters + +if ($null -ne $pp['path']){ + $lpath = $pp['path'] +} +elseif (Test-Path env:linkerdPath) { + $lpath = $env:linkerdPath +} +else { + $lpath = $toolsPath +} + +if ($null -ne $pp['checksum']){ + $checksum = $pp['checksum'] +} +else{ + $checksum = $env:linkerdCheckSum +} + +$packageArgs = @{ + packageName = 'linkerd' + fileFullPath = "$lpath\linkerd.exe" + url64 = "https://github.com/linkerd/linkerd2/releases/download/stable-$version/linkerd2-cli-stable-$version-windows.exe" + checksum = $checksum + checksumType = 'sha256' +} + +Get-ChocolateyWebFile @packageArgs +Install-ChocolateyPath $packageArgs.fileFullPath 'User'