45 lines
1.8 KiB
Ruby
45 lines
1.8 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.12.4",
|
|
:revision => "5c7bab28cb121a70b64b67ccf923f71a6e30e0d3"
|
|
head "https://github.com/kubernetes-incubator/kube-aws.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "5d80b137f5b73e92a207242a4a6035d93665a48794525170d35389cf01399030" => :mojave
|
|
sha256 "d813f2c49bcddf83f1624492baedd9416d95b9ad7edad8a6e0be7dd483a78b2f" => :high_sierra
|
|
sha256 "489d590e8a23dacb8f5168ec567408ef3d3200dcfd22fb03389d648c0be39d9b" => :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
|