45 lines
1.8 KiB
Ruby
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.0",
|
|
:revision => "d7e327d3da1e08021edd8bf24cc72fef4132f0af"
|
|
head "https://github.com/kubernetes-incubator/kube-aws.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "a9078fbf661e698806792606b197374af301b2024ad42d54e7dfb8f0df4e0123" => :mojave
|
|
sha256 "4bdc3016b4e20a9c57a932aea241fcf70ba8d76ca03039122bd9531ea7643b63" => :high_sierra
|
|
sha256 "fffdabcce63790444868136d02ddd1e995855f6f841685545e25123e18d53671" => :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
|