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.5",
|
|
:revision => "1556cc00b507400bafae7bfd4e37e565a7c83a5d"
|
|
head "https://github.com/kubernetes-incubator/kube-aws.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "0a6d5bc9c145746655b840ef39a2a7a4166de0f167fbb537d3edd8ade11ccd50" => :mojave
|
|
sha256 "a9f2d01352a82b6e59a859b5cf37e0d708ef2e0ae818f13e70dd3562e53d46d3" => :high_sierra
|
|
sha256 "29683ca32f02a7dd8a7c8cdb738f5cad8214c324904e6ac155d3c983485ed6e0" => :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
|