homebrew-core/Formula/kube-aws.rb
2018-05-04 01:13:33 -07:00

45 lines
1.8 KiB
Ruby

class KubeAws < Formula
desc "CoreOS Kubernetes on AWS"
homepage "https://coreos.com/kubernetes/docs/latest/kubernetes-on-aws.html"
url "https://github.com/kubernetes-incubator/kube-aws.git",
:tag => "v0.9.10",
:revision => "15458e8469ce1f3c7bce7a11ef3a0ab405cd1950"
head "https://github.com/kubernetes-incubator/kube-aws.git"
bottle do
cellar :any_skip_relocation
sha256 "4ffce6523ef7f1de41c77e7dba6ec03161f0bd53ac6fd1ef76c5d1481d48363c" => :high_sierra
sha256 "62637f6a3da39a0b90d984e9326726e467b91c124046794a60e145f98e1c29f2" => :sierra
sha256 "4cd79914c9d1c725dc4704037e535a566ca7e68f497f569061c9cb6c8ff39825" => :el_capitan
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