homebrew-core/Formula/docker-machine.rb

65 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.13.0",
:revision => "9ba6da9ebd1140b65eb73e1ce08086ca72764c60"
head "https://github.com/docker/machine.git"
bottle do
cellar :any_skip_relocation
sha256 "f69505083b87c7964014ecaa1ccf5615f5e5b331aa682429a148113f9a480261" => :high_sierra
sha256 "5c2daef1c95e61be256fd1c2e428e342a3f1c5d895e33a3666fabdf9c3dbf1e4" => :sierra
sha256 "67c92599ec8b67662dda5f75ad187b5c53896eedf81c6af808b36bd84f01e5ad" => :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