From 455bed3b870e091ed683609f9f990e86f0600187 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 20 Aug 2016 11:31:59 +0200 Subject: Upload default configuration on initial deploy. --- config/deploy.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'config') diff --git a/config/deploy.rb b/config/deploy.rb index 53b4fb3..43ec4c6 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -16,6 +16,24 @@ set :linked_dirs, fetch(:linked_dirs, []).push('public/uploads') # set :keep_releases, 5 namespace :deploy do + file 'config.yml' do |f| + template = "---\n" + + "contact_email: contact@example.com\n" + + "smtp:\n" + + " address: localhost\n" + + " port: 25\n" + + "accept_registrations:\n" + + " start: YYYY.MM.DD\n" + + " stop: YYYY.MM.DD\n" + IO.write(t.name, template) + end + + before 'check:linked_files', :upload_config => 'config.yml' do |t| + on roles(:app) do + shared_dir = File.join(fetch(:deploy_to), 'shared') + upload!(t.prerequisites.first, File.join(shared_dir, t.prerequisites.first)) + end + end after :restart, :clear_cache do on roles(:web), in: :groups, limit: 3, wait: 10 do -- cgit v1.2.3