homebrew-core/Formula/kube-aws.rb
2019-02-07 16:02:41 +08: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.12.2",
:revision => "73136f96f097612b7566c3272c1b3cd48d4a0db2"
head "https://github.com/kubernetes-incubator/kube-aws.git"
bottle do
cellar :any_skip_relocation
sha256 "6b048c872c17fce2a11fcb6a0935363f83ccea515623d579c6b0a44315f6cbe8" => :mojave
sha256 "57b9ac7f0359d13138e7721131023199545f1eab296921b1dca5c363df2b6395" => :high_sierra
sha256 "a0e3ae85e6430684b0e3c5d6ccc439e375be99e835240fb5ca8a0a273abe5666" => :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