2016-06-09 18:55:09 +00:00
|
|
|
class Dvm < Formula
|
|
|
|
desc "Docker Version Manager"
|
|
|
|
homepage "https://github.com/getcarina/dvm"
|
2016-10-04 14:50:24 +00:00
|
|
|
url "https://github.com/getcarina/dvm/archive/0.6.4.tar.gz"
|
|
|
|
sha256 "7ff3bc5271432b7f5da535cd04228bf212dd2965ed15998837d660452094ff0e"
|
2016-06-09 18:55:09 +00:00
|
|
|
|
2016-06-13 16:06:38 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-10-04 15:29:08 +00:00
|
|
|
sha256 "e046329279fd7c2c093a4159b60755161370721400e10da6df23a34a1efa97eb" => :sierra
|
|
|
|
sha256 "a47592736f3dff452ac0060602bf915a763255102fe75adaf6e6dea4203f4ceb" => :el_capitan
|
|
|
|
sha256 "beb50586491e083878940a059491b4ab40802e5fb417876532a7185340ab8d48" => :yosemite
|
2016-06-13 16:06:38 +00:00
|
|
|
end
|
|
|
|
|
2016-10-04 14:37:54 +00:00
|
|
|
depends_on "glide" => :build
|
2016-06-09 18:55:09 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
2016-10-04 14:37:54 +00:00
|
|
|
ENV["GLIDE_HOME"] = HOMEBREW_CACHE/"glide_home/#{name}"
|
|
|
|
ENV.append_path "PATH", buildpath/"bin"
|
2016-06-09 18:55:09 +00:00
|
|
|
|
2016-10-04 14:37:54 +00:00
|
|
|
dir = buildpath/"src/github.com/getcarina/dvm"
|
|
|
|
dir.install buildpath.children
|
2016-06-09 18:55:09 +00:00
|
|
|
|
2016-10-04 14:37:54 +00:00
|
|
|
cd dir do
|
|
|
|
# `depends_on "glide"` already has this covered
|
|
|
|
inreplace "Makefile", %r{^.*go get github.com/Masterminds/glide.*$\n}, ""
|
2016-06-09 18:55:09 +00:00
|
|
|
|
2016-10-04 14:37:54 +00:00
|
|
|
system "make", "VERSION=#{version}", "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"
|
2016-10-04 14:37:54 +00:00
|
|
|
prefix.install_metafiles
|
2016-06-09 18:55:09 +00:00
|
|
|
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
|