homebrew-core/Formula/kube-aws.rb
2019-10-14 09:05:43 +02:00

46 lines
1.9 KiB
Ruby

class KubeAws < Formula
desc "Command-line tool to declaratively manage Kubernetes clusters on AWS"
homepage "https://kubernetes-incubator.github.io/kube-aws/"
url "https://github.com/kubernetes-incubator/kube-aws.git",
:tag => "v0.14.1",
:revision => "34342f7153e7a6f601438026174d4d68e8f9eda5"
head "https://github.com/kubernetes-incubator/kube-aws.git"
bottle do
cellar :any_skip_relocation
sha256 "068a3cbb7f097bff550171062d9ed85db12c778c1769d1280ddd2a0a41ab8baf" => :catalina
sha256 "18e2da3a952fb04a061d0765cb1f183f7399a6360723ed8e408b56b4ef2069a7" => :mojave
sha256 "469566a099c761183a7d40a9c7d47691bc210c30f2cbe93c4b40d791d9cc8d11" => :high_sierra
sha256 "61dfb1788f25c19227b55a8019e574fd7bf7e99366b4567f5fa33694c4d5abc4" => :sierra
end
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
dir = buildpath/"src/github.com/kubernetes-incubator/kube-aws"
dir.install buildpath.children - [buildpath/".brew_home"]
cd dir do
system "make", "OUTPUT_PATH=#{bin}/kube-aws"
prefix.install_metafiles
end
end
test do
system "#{bin}/kube-aws"
system "#{bin}/kube-aws", "init", "--cluster-name", "test-cluster",
"--external-dns-name", "dns", "--region", "us-west-1",
"--availability-zone", "zone", "--key-name", "key",
"--kms-key-arn", "arn", "--no-record-set",
"--s3-uri", "s3://examplebucket/mydir"
cluster_yaml = (testpath/"cluster.yaml").read
assert_match "clusterName: test-cluster", cluster_yaml
assert_match "dnsName: dns", cluster_yaml
assert_match "region: us-west-1", cluster_yaml
assert_match "availabilityZone: zone", cluster_yaml
assert_match "keyName: key", cluster_yaml
assert_match "kmsKeyArn: \"arn\"", cluster_yaml
installed_version = shell_output("#{bin}/kube-aws version 2>&1")
assert_match "kube-aws version v#{version}", installed_version
end
end