2016-06-09 18:55:09 +00:00
|
|
|
class Dvm < Formula
|
|
|
|
desc "Docker Version Manager"
|
|
|
|
homepage "https://github.com/getcarina/dvm"
|
2016-07-18 18:53:02 +00:00
|
|
|
url "https://github.com/getcarina/dvm/archive/0.6.3.tar.gz"
|
|
|
|
sha256 "09089036d881a6f3544198d93be82e5861cbc5f8682bfa3466e4d099923eb493"
|
2016-06-09 18:55:09 +00:00
|
|
|
|
2016-06-13 16:06:38 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-07-18 19:21:06 +00:00
|
|
|
sha256 "e1cc9876c3f0a77bde1f9db2821f91a80c22b8575816a6e903223ed0bcd08c3f" => :el_capitan
|
|
|
|
sha256 "ae148f98c7a88130e344036f769b4b94c9e278ede6362c5dd17efb6ab4b33824" => :yosemite
|
|
|
|
sha256 "ddb8a34197f47b6b53e5fe8d599d8678cea60a63e33edd96b86b0a9646fe51cf" => :mavericks
|
2016-06-13 16:06:38 +00:00
|
|
|
end
|
|
|
|
|
2016-06-09 18:55:09 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
2016-07-18 18:53:02 +00:00
|
|
|
ENV["PATH"] = "#{ENV["PATH"]}:#{buildpath}/bin"
|
2016-06-09 18:55:09 +00:00
|
|
|
|
|
|
|
dvmpath = buildpath/"src/github.com/getcarina/dvm"
|
|
|
|
dvmpath.install Dir["{*,.git}"]
|
|
|
|
|
|
|
|
cd dvmpath do
|
2016-07-18 18:53:02 +00:00
|
|
|
system "make", "VERSION=#{version}", "COMMIT=65c380cf2079fa5387ca49c7b5552ae4e2ec3b77", "UPGRADE_DISABLED=true"
|
2016-06-09 18:55:09 +00:00
|
|
|
|
|
|
|
prefix.install "dvm.sh"
|
2016-07-18 18:53:02 +00:00
|
|
|
prefix.install "bash_completion"
|
2016-06-09 18:55:09 +00:00
|
|
|
(prefix/"dvm-helper").install "dvm-helper/dvm-helper"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
dvm is a shell function, and must be sourced before it can be used.
|
|
|
|
Add the following command to your bash profile:
|
2016-06-16 21:06:56 +00:00
|
|
|
|
|
|
|
[[ -s "$(brew --prefix dvm)/dvm.sh" ]] && source "$(brew --prefix dvm)/dvm.sh"
|
|
|
|
|
2016-07-18 18:53:02 +00:00
|
|
|
To enable tab completion of commands, add the following command to your bash profile:
|
|
|
|
[[ -s "$(brew --prefix dvm)/bash_completion" ]] && source "$(brew --prefix dvm)/bash_completion"
|
|
|
|
|
2016-06-09 18:55:09 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
output = shell_output("bash -c 'source #{prefix}/dvm.sh && dvm --version'")
|
|
|
|
assert_match "Docker Version Manager version #{version}", output
|
|
|
|
end
|
|
|
|
end
|