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.3", :revision => "8014c5c331ede99f2eab371cc41f81ad40e5607c" head "https://github.com/kubernetes-incubator/kube-aws.git" bottle do cellar :any_skip_relocation sha256 "f0b1583eb75932cbc1db07d78a1ce63c0629098df97bc78091831c0742c878f9" => :catalina sha256 "1219db803ad5dc3825dcd5d199b1c7cb2f08eb904a88ef38df6d8d1e3f041292" => :mojave sha256 "d3ee4593133be9a3ec09bdd3d683cf95f5ffc0797119bdb90c7ace7077384094" => :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