homebrew-core/Formula/docker-machine.rb
2018-03-06 23:03:38 -08:00

64 lines
2.1 KiB
Ruby

class DockerMachine < Formula
desc "Create Docker hosts locally and on cloud providers"
homepage "https://docs.docker.com/machine"
url "https://github.com/docker/machine.git",
:tag => "v0.14.0",
:revision => "89b833253d9412716a0291cbdccc94454c33d1b5"
head "https://github.com/docker/machine.git"
bottle do
cellar :any_skip_relocation
sha256 "0900893dbf62189c7c67785c96d2040beec0f5276f4848bde3a1d2b170682635" => :high_sierra
sha256 "5229f4367948476c5b4c6bb0e5c17c9e6d0e2b2ec2cdc02e14a87e35dc7267ca" => :sierra
sha256 "263aa459a2fbd1f660d16049202d3e831dd8da7153c2a0c8cb642f57b94ad1af" => :el_capitan
end
depends_on "go" => :build
depends_on "automake" => :build
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/docker/machine").install buildpath.children
cd "src/github.com/docker/machine" do
system "make", "build"
bin.install Dir["bin/*"]
bash_completion.install Dir["contrib/completion/bash/*.bash"]
zsh_completion.install "contrib/completion/zsh/_docker-machine"
prefix.install_metafiles
end
end
plist_options :manual => "docker-machine start"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:#{HOMEBREW_PREFIX}/bin</string>
</dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/docker-machine</string>
<string>start</string>
<string>default</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
test do
assert_match version.to_s, shell_output(bin/"docker-machine --version")
end
end