-
Notifications
You must be signed in to change notification settings - Fork 28
/
top level.rb
63 lines (56 loc) · 2.93 KB
/
top level.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
dep 'system', :host_name, :locale_name do
requires [
'common:set.locale'.with(locale_name),
'core software',
'hostname'.with(host_name),
'secured ssh logins',
'lax host key checking',
'admins can sudo',
'tmp cleaning grace period'
]
requires 'bad certificates removed' if Babushka.host.linux?
setup {
unmeetable! "This dep has to be run as root." unless shell('whoami') == 'root'
}
end
dep 'user setup', :username, :key do
username.default(shell('whoami'))
requires [
'dot files'.with(:username => username),
'passwordless ssh logins'.with(username, key),
'public key',
'zsh'.with(username)
]
end
dep 'rails app', :domain, :domain_aliases, :username, :path, :listen_host, :listen_port, :proxy_host, :proxy_port, :env, :nginx_prefix, :enable_http, :enable_https, :force_https, :data_required do
requires 'rack app'.with(domain, domain_aliases, username, path, listen_host, listen_port, proxy_host, proxy_port, env, nginx_prefix, enable_http, enable_https, force_https, data_required)
requires 'db'.with(username, path, env, data_required, 'yes')
end
dep 'rack app', :domain, :domain_aliases, :username, :path, :listen_host, :listen_port, :proxy_host, :proxy_port, :env, :nginx_prefix, :enable_http, :enable_https, :force_https, :data_required do
username.default!(shell('whoami'))
path.default('~/current')
env.default(ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'production')
requires 'webapp'.with('unicorn', domain, domain_aliases, username, path, listen_host, listen_port, proxy_host, proxy_port, nginx_prefix, enable_http, enable_https, force_https)
requires 'web repo'.with(path)
requires 'app bundled'.with(path, env)
requires 'rack.logrotate'.with(username)
end
dep 'proxied app' do
requires 'webapp'.with(:type => 'proxy')
end
dep 'webapp', :type, :domain, :domain_aliases, :username, :path, :listen_host, :listen_port, :proxy_host, :proxy_port, :nginx_prefix, :enable_http, :enable_https, :force_https do
username.default!(domain)
requires 'user exists'.with(username, '/srv/http')
requires 'vhost enabled.nginx'.with(type, domain, domain_aliases, path, listen_host, listen_port, proxy_host, proxy_port, nginx_prefix, enable_http, enable_https, force_https)
requires 'running.nginx'
end
dep 'core software' do
requires {
# tmux isn't available on lenny.
on :lenny, 'sudo.bin', 'lsof.bin', 'vim.bin', 'curl.bin', 'traceroute.bin', 'htop.bin', 'iotop.bin', 'jnettop.bin', 'nmap.bin', 'tree.bin', 'pv.bin'
# jnettop isn't available on arch.
on :arch, 'sudo.bin', 'lsof.bin', 'vim.bin', 'curl.bin', 'traceroute.bin', 'htop.bin', 'iotop.bin', 'tmux.bin', 'nmap.bin', 'tree.bin', 'pv.bin'
on :linux, 'sudo.bin', 'lsof.bin', 'vim.bin', 'curl.bin', 'traceroute.bin', 'htop.bin', 'iotop.bin', 'jnettop.bin', 'tmux.bin', 'nmap.bin', 'tree.bin', 'pv.bin'
on :osx, 'sudo.bin', 'lsof.bin', 'vim.bin', 'curl.bin', 'traceroute.bin', 'tmux.bin', 'nmap.bin', 'tree.bin', 'pv.bin'
}
end