80 lines
3.5 KiB
Ruby
80 lines
3.5 KiB
Ruby
class Kubeseal < Formula
|
|
desc "Kubernetes controller and tool for one-way encrypted Secrets"
|
|
homepage "https://github.com/bitnami-labs/sealed-secrets"
|
|
url "https://github.com/bitnami-labs/sealed-secrets.git",
|
|
tag: "v0.15.0",
|
|
revision: "b7a8397e47a8048ae17a089a3dc7ac0e65b89613"
|
|
license "Apache-2.0"
|
|
|
|
livecheck do
|
|
url :stable
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "2b2b04769887b909071e2f02b63e218731e7b1255a5357c4c456688ab27b62fd"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "e98da4889c647805e7463902f07853e89a0349abe6bd37e7cf428a5cee47c5bd"
|
|
sha256 cellar: :any_skip_relocation, catalina: "ee40961cf27306ed94cb040ad881fd19b07dce624d3a031bdf24122cf41243bd"
|
|
sha256 cellar: :any_skip_relocation, mojave: "6913e64b44f9851c656e1789c2118c2038e3dc73f5ce74af381f212f7f33a90d"
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
|
|
def install
|
|
system "make", "kubeseal", "DIRTY="
|
|
bin.install "kubeseal"
|
|
end
|
|
|
|
test do
|
|
# ensure build reports the (git tag) version
|
|
output = shell_output("#{bin}/kubeseal --version")
|
|
assert_equal "kubeseal version: v#{version}", output.strip
|
|
|
|
# ensure kubeseal can seal secrets
|
|
secretyaml = [
|
|
"apiVersion: v1",
|
|
"kind: Secret",
|
|
"metadata:",
|
|
" name: mysecret",
|
|
" namespace: default",
|
|
"type: Opaque",
|
|
"data:",
|
|
" username: YWRtaW4=",
|
|
" password: MWYyZDFlMmU2N2Rm",
|
|
].join("\n") + "\n"
|
|
cert = [
|
|
"-----BEGIN CERTIFICATE-----",
|
|
"MIIErTCCApWgAwIBAgIQKBFEtKBDXcPklduZRLUirTANBgkqhkiG9w0BAQsFADAA",
|
|
"MB4XDTE4MT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BL85mg88AlmpPYX5P++Pk5h+i6CenVFPDKwVHDc0vTB",
|
|
"z4yO7MJmSmvGAkjAjmU0s37t3wfWyQpgID8uZmKNbvH8Ie0Y/fSuHz42HMOtb1SI",
|
|
"5ck8jVpQgJwpfNVAy9fwwdyCdKKEGyGmo8oPYAT5Y9GFZh8dqoqVqATwJqLUe//V",
|
|
"OEDxoRV+BXesbpJbJ8tOVtBHzoDU+tjx1jTchf2iWOPByIRQYNBvk25UWNnkdFLy",
|
|
"f9PDrMo6axh+kjQTqrJ4JChL9qHXwSjTshaEcR272xD4vuRX+VMstQqRPwVElRnf",
|
|
"o+MQ5YUiwulFnSykR5zY0U1jGdjywOzxRDLHsPo1WWnOuzfcHarM+YoMDnFzrOzJ",
|
|
"EwP0zIygDpFytgh+Uq+ypKav7CHdA/yy/eWjDJI8b6gKB3mDB5pF+0KtBV61kbfF",
|
|
"7+dVEtF0wQK+0CUdFtFRv3sk5Ud6wHrvMVTY7I4UcHVBe08DhrNJujHzTjolfXTj",
|
|
"s0IweLRbZLe3m/9JLdW6WxylJSUBJhFJGASNwiAm9FwlwryLXzsjNHV/8Y6NkEnf",
|
|
"JQ==",
|
|
"-----END CERTIFICATE-----",
|
|
].join("\n") + "\n"
|
|
|
|
File.write("cert.pem", cert)
|
|
pipe_output("#{bin}/kubeseal --cert cert.pem", secretyaml)
|
|
end
|
|
end
|