This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtc.rb
102 lines (88 loc) · 2.31 KB
/
tc.rb
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
dep "tc system", :app_user, :key, :env do
requires "throttling".with(env) # Temporarily ban misbehaving clients
end
dep "tc env vars set", :domain
dep "tc app", :env, :host, :domain, :app_user, :app_root, :key do
requires [
"postgres extension".with(app_user, Util.database_name(app_root, env), "unaccent"),
"postgres extension".with(app_user, Util.database_name(app_root, env), "pg_trgm"),
"postgres extension".with(app_user, Util.database_name(app_root, env), "fuzzystrmatch")
]
requires [
"user exists".with(username: app_user),
"delayed job".with(
env: env,
user: app_user
),
"delayed job".with(
env: env,
user: app_user,
queue: "mailers"
),
"delayed job".with(
env: env,
user: app_user,
queue: "user_interface"
),
"db".with(
env: env,
username: app_user,
root: app_root,
data_required: "yes"
),
"postgres replication monitoring".with(test_user: app_user),
"rails app".with(
app_name: "tc",
env: env,
domain: domain,
username: app_user,
path: app_root,
enable_https: "yes"
)
]
end
dep "tc packages" do
requires [
"postgres",
"postgresql-contrib.lib", # for unaccent, for search
"running.postfix",
"running.nginx",
"tc common packages"
]
end
dep "tc dev" do
requires [
"tc common packages",
"pv.bin", # for db:production:pull (and it's awesome anyway)
"phantomjs", # for js testing
"geoip database".with(app_root: "."),
"submodules cloned",
"npm packages installed".with("vendor/sharejs")
]
end
dep "submodules cloned" do
met? do
# Initalised and current submodules are listed with a leading ' '.
shell("git submodule status").split("\n").all? {|l| l[/^ /] }
end
meet do
shell("git submodule update --init")
end
end
dep "tc common packages" do
requires [
"bundler.gem",
"curl.lib",
"postgres.bin",
"geoip.bin", # for geoip-c
"aspell dictionary.lib",
"coffeescript.bin", # for barista
"yarn.npm",
"tidy.bin", # for upmark preprocessing in MarkdownController
"imagemagick.bin", # for paperclip
"pngquant.bin", # for reducing the size of PNGs
"libxml.lib", # for nokogiri
"libxslt.lib", # for nokogiri
"libtag.lib" # for taglib-ruby gem
]
end