Skip to content

Instantly share code, notes, and snippets.

@Mikulas
Created May 22, 2017 12:33
Show Gist options
  • Save Mikulas/f7c878c345bfaa4385bb39f5f5c61dab to your computer and use it in GitHub Desktop.
Save Mikulas/f7c878c345bfaa4385bb39f5f5c61dab to your computer and use it in GitHub Desktop.
require "language/go"
class Migrate < Formula
desc "Go CLI for database migrations"
homepage "https://github.com/mattes/migrate"
url "https://github.com/mattes/migrate/archive/v3.0.1.tar.gz"
sha256 "c3847f260e283929db8a39d8a0273db2f6c2d96ab3aee2dba7053a83f4b61e22"
head "https://github.com/mattes/migrate/archive/master.zip"
depends_on "go" => :build
go_resource "github.com/lib/pq" do
url "https://github.com/lib/pq.git",
:revision => "2704adc878c21e1329f46f6e56a1c387d788ff94"
end
def install
ENV["GOROOT"] = nil
ENV["GOPATH"] = buildpath
mkdir_p "src/github.com/mattes"
ln_s buildpath, "src/github.com/mattes/migrate"
#Language::Go.stage_deps resources, buildpath/"src"
system "go", "get", "-u", "-d", "github.com/mattes/migrate/cli", "github.com/lib/pq"
system "go", "build", "-tags", "'postgres'", "-o", "/usr/local/bin/migrate", "github.com/mattes/migrate/cli"
system "ls", "-lA"
# system "go", "build", "-tags", "postgres", "-o", bin/"migrate"
end
test do
system bin/"migrate", "-version"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment