summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2016-08-20 11:31:59 +0200
committerHarald Eilertsen <haraldei@anduin.net>2016-08-20 11:31:59 +0200
commit455bed3b870e091ed683609f9f990e86f0600187 (patch)
tree4ce113402716b994aa886b14bf0fead1b0acbfa9
parent9c74a587b236407118cd47d6f2e43ee5000a0edd (diff)
downloadnorsk-urskog-registrations-455bed3b870e091ed683609f9f990e86f0600187.tar.gz
norsk-urskog-registrations-455bed3b870e091ed683609f9f990e86f0600187.tar.bz2
norsk-urskog-registrations-455bed3b870e091ed683609f9f990e86f0600187.zip
Upload default configuration on initial deploy.
-rw-r--r--config/deploy.rb18
1 files changed, 18 insertions, 0 deletions
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