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.2", :revision => "fd0bdbe6d476318f0076d709e3643a08999a9e95" head "https://github.com/kubernetes-incubator/kube-aws.git" bottle do cellar :any_skip_relocation sha256 "f2e08350a7258a9f5679c83aa3635b8646b5aa86c0337eda5e4c023d3af9d40b" => :catalina sha256 "8b402c944c54683c85130bfc0711d12b991d1288d1eff24942fcd812adb3c04d" => :mojave sha256 "3db554acae43e8d8d651bf166853c7b7e23a098f4bb85e9a6dfe80afa9f1299e" => :high_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