Formula/kubelogin.rb (34 lines of code) (raw):
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
class Kubelogin < Formula
desc "A Kubernetes credential (exec) plugin implementing azure authentication"
homepage "https://github.com/Azure/kubelogin"
version "0.2.8"
license "MIT"
case
when OS.mac? && Hardware::CPU.intel?
url "https://github.com/Azure/kubelogin/releases/download/v#{version}/kubelogin-darwin-amd64.zip"
sha256 "f0d7ce985e683ab3587c2ed95fc58758dcf306b2fea34476efa5a9873f48854b"
when OS.mac? && Hardware::CPU.arm?
url "https://github.com/Azure/kubelogin/releases/download/v#{version}/kubelogin-darwin-arm64.zip"
sha256 "f5a9cfe7ba45d26b612a70d923ad6a1da645bc3d0cb30a60ec81aa65fed24997"
when OS.linux? && Hardware::CPU.intel?
url "https://github.com/Azure/kubelogin/releases/download/v#{version}/kubelogin-linux-amd64.zip"
sha256 "4d9ef72db9d298bceae76e7ba04fabe354b2bf8af1d79fad5b6edacb85c8fb97"
else
odie "Unexpected platform!"
end
def install
case
when OS.mac? && Hardware::CPU.intel?
bin.install "darwin_amd64/kubelogin"
when OS.mac? && Hardware::CPU.arm?
bin.install "darwin_arm64/kubelogin"
when OS.linux? && Hardware::CPU.intel?
bin.install "linux_amd64/kubelogin"
else
odie "Unexpected platform!"
end
end
test do
system bin/name, "version"
end
end