blob: 81921303ea92b2ba6ba5b95e5648d6502106ef70 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# :mode=ruby:
require 'securerandom'
require 'active_support/inflector'
namespace :deploy do
namespace :refinery do
desc 'Initialize refinery config for new deployments.'
task :setup do
output_file = File.join(shared_path, "config", "initializers", "refinery", "core.rb")
on roles(:app) do
unless test "[ -f #{output_file} ]"
template = IO.read(File.join("config", "initializers", "refinery", "core.rb.erb"))
core = ERB.new(template)
site_name = fetch(:site_name, "Beta")
upload!(StringIO.new(core.result(binding)), output_file)
end
end
end
end
before 'deploy:check:linked_files', 'deploy:refinery:setup'
end
|