11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/rda/app.rb', line 11
def deploy
conf_dir = Rda.config.nginx.conf_dir
unless Rda::Nginx.setup?
$stderr.puts 'ERROR: Nginx is not set up properly. Please run `rda nginx setup` first.'
return
end
domain = Rda.config.domain
template("templates/nginx", "#{conf_dir}/sites-available/#{domain}")
link_file("#{conf_dir}/sites-available/#{domain}", "#{conf_dir}/sites-enabled/#{domain}")
unless configured?('/etc/hosts', "127.0.0.1 #{domain}")
append_file "/etc/hosts", "127.0.0.1 #{domain}\n"
end
end
|