summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.ru6
-rw-r--r--config/deploy.rb20
2 files changed, 17 insertions, 9 deletions
diff --git a/config.ru b/config.ru
index 897dd21..a772481 100644
--- a/config.ru
+++ b/config.ru
@@ -1,2 +1,6 @@
require './registration.rb'
-run RegistrationApp
+
+base_path = ENV['NUREG_BASE'] || '/'
+map base_path do
+ run RegistrationApp
+end
diff --git a/config/deploy.rb b/config/deploy.rb
index 7d78cce..bd5965c 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -4,10 +4,8 @@ lock '3.11.0'
set :application, 'registration'
set :repo_url, 'https://code.volse.no/norsk-urskog-registrations.git'
set :deploy_to, '/usr/home/norskurskog/www/registration'
-set :linked_files, fetch(:linked_files, []).push('config.yml')
-
-# Default value for linked_dirs is []
-set :linked_dirs, fetch(:linked_dirs, []).push('public/uploads', 'bin', 'log', 'tmp')
+append :linked_files, 'config.yml', '.env'
+append :linked_dirs, 'public/uploads', 'bin', 'log', 'tmp'
set :bundle_binstubs, -> { shared_path.join('bin') }
@@ -30,11 +28,17 @@ namespace :deploy do
IO.write(t.name, template)
end
- before 'check:linked_files', :upload_config => 'config.yml' do |t|
+ file '.env' do |f|
+ IO.write(t.name, "NUREG_BASE=/\n")
+ end
+
+ before 'check:linked_files', :upload_config => ['config.yml', '.env'] do |t|
on roles(:app) do
- target_file = File.join(fetch(:deploy_to), 'shared', t.prerequisites.first)
- unless test("[ -f #{target_file} ]")
- upload!(t.prerequisites.first, target_file)
+ t.prerequisites.each do |r|
+ target_file = File.join(fetch(:shared_directory), r)
+ unless test("[ -f #{target_file} ]")
+ upload!(t.prerequisites.first, target_file)
+ end
end
end
end