46 lines
1.9 KiB
Ruby
46 lines
1.9 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.10.2",
|
|
:revision => "533236d5e766eea270827123f20fc00a680f65e9"
|
|
head "https://github.com/kubernetes-incubator/kube-aws.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "c1813734f98b1a08a20bdb776d258b8f772d23a56e510494555600b8111f886a" => :mojave
|
|
sha256 "ebc6c3d0bada00c947dbc928516bb2419779d234bd8fc5da3a79b6d6559c7340" => :high_sierra
|
|
sha256 "35ec742eb54ae1ec5a874871bce526a94a73b920f8d2ed0a2294e37518d1ed04" => :sierra
|
|
sha256 "8f946fae1cd903ca0125f4f3b655c96ed96a1c0970581a8a993ee31093bcadfa" => :el_capitan
|
|
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
|