summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/deploy.rb7
-rw-r--r--config/deploy/staging.rb4
2 files changed, 7 insertions, 4 deletions
diff --git a/config/deploy.rb b/config/deploy.rb
index bd5965c..8240df3 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -4,6 +4,7 @@ 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 :shared_directory, File.join(fetch(:deploy_to), 'shared')
append :linked_files, 'config.yml', '.env'
append :linked_dirs, 'public/uploads', 'bin', 'log', 'tmp'
@@ -25,11 +26,11 @@ namespace :deploy do
+ "accept_registrations:\n"
+ " start: YYYY.MM.DD\n"
+ " stop: YYYY.MM.DD\n"
- IO.write(t.name, template)
+ IO.write(f.name, template)
end
file '.env' do |f|
- IO.write(t.name, "NUREG_BASE=/\n")
+ IO.write(f.name, "export NUREG_BASE=/\n")
end
before 'check:linked_files', :upload_config => ['config.yml', '.env'] do |t|
@@ -37,7 +38,7 @@ namespace :deploy do
t.prerequisites.each do |r|
target_file = File.join(fetch(:shared_directory), r)
unless test("[ -f #{target_file} ]")
- upload!(t.prerequisites.first, target_file)
+ upload!(r, target_file)
end
end
end
diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb
index 469e3e0..20732be 100644
--- a/config/deploy/staging.rb
+++ b/config/deploy/staging.rb
@@ -1,2 +1,4 @@
server 'volse.local', user: 'norskurskog', roles: %w{app db web}
-set :branch, 'staging'
+
+# Ask for which branch to deploy, default is current branch.
+ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call