-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfaktory.erb
46 lines (37 loc) · 1.37 KB
/
faktory.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class Faktory < Formula
desc "High-performance background job server"
homepage "https://github.com/contribsys/faktory"
url "https://github.com/contribsys/faktory/tarball/v<%= version %>"
sha256 "<%= sha %>"
depends_on "redis"
depends_on "go" => :build
resource "ego" do
url "https://github.com/benbjohnson/ego/archive/v0.4.1.tar.gz"
sha256 "dbae6aa7f5286606e6a21ba81e09a2dfa63616d79edb23db79d07407701a7162"
end
def install
go_bin_path = "#{buildpath}/bin"
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/contribsys/faktory").install buildpath.children
mkdir go_bin_path
ENV.prepend_path "PATH", go_bin_path
resource("ego").stage do |stage|
(buildpath/"src/github.com/benbjohnson/ego").install Pathname("#{stage.staging.tmpdir}/ego-0.4.1").children
cd "#{buildpath}/src/github.com/benbjohnson/ego" do
system "go", "build", "-o", "#{go_bin_path}/ego", "./cmd/ego"
end
end
cd "src/github.com/contribsys/faktory" do
system "go", "generate", "github.com/contribsys/faktory/webui"
system "go", "build", "-o", bin/"faktory", "./cmd/faktory/daemon.go"
prefix.install_metafiles
end
end
service do
run bin/"faktory"
environment_variables PATH: "#{HOMEBREW_PREFIX}/sbin:/usr/sbin:/usr/bin:/bin:#{HOMEBREW_PREFIX}/bin"
end
test do
shell_output("#{bin}/faktory -v", 0)
end
end