Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,6 @@ jobs:
! -name test-scale \
! -name update-go-deps-shas \
! -name web \
! -name *.nuspec \
! -name *.ps1 \
| xargs -I {} bin/shellcheck -x {}
32 changes: 32 additions & 0 deletions bin/win/linkerd.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shellcheck is parsing this file as a script, and we should add it to the list of ignored files in static_check.yml.

! -name *.nuspec \

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out! Will add it or ! -name win \ after resolving the previous comments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! Looking forward to getting this committed and merged.

<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>linkerd</id>
<version>${LINKERD_VERSION}</version>

<title>Linkerd</title>
<authors>Linkerd</authors>
<summary>Ultralight service mesh for Kubernetes and beyond</summary>
<description>
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.
</description>

<projectUrl>https://github.com/linkerd/linkerd2</projectUrl>
<licenseUrl>https://github.com/linkerd/linkerd2/blob/master/LICENSE</licenseUrl>
<releaseNotes>https://github.com/linkerd/linkerd2/releases</releaseNotes>
<docsUrl>https://linkerd.io/docs</docsUrl>

<dependencies>
<dependency id="chocolatey-core.extension" version="1.1.0" />
</dependencies>
</metadata>

<files>
<file src="bin\win\tools\**" target="tools" />
</files>
</package>
33 changes: 33 additions & 0 deletions bin/win/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -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'