64 lines
2.1 KiB
Ruby
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.16.1",
|
|
:revision => "cce350d75c529cf6e77328d9dd0477357e04a776"
|
|
head "https://github.com/docker/machine.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "a039c02209a33f24fe08eb19a9a1b62050094ffbefac4d14f503256bdd563239" => :mojave
|
|
sha256 "c96f4ce5a408afabbe1fb7d9ab5fa103a3dffbae5b4f6253a8e328b817a068a2" => :high_sierra
|
|
sha256 "03243f9afedc25d7e3f519749639bd873bc27ef109e05aa8d86785b196d8dcc4" => :sierra
|
|
end
|
|
|
|
depends_on "automake" => :build
|
|
depends_on "go" => :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
|