summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2016-09-22 21:19:30 +0200
committerHarald Eilertsen <haraldei@anduin.net>2016-09-22 21:19:30 +0200
commita147a9a6c761d5d867c24bbea09f4d558591e07c (patch)
tree439c078b3bf7592d4b2639127d4a0554c5de2769 /config
parent653e7c74e41c97c1ba15682a7d6e41123dc4ac56 (diff)
downloadnorsk-urskog-registrations-a147a9a6c761d5d867c24bbea09f4d558591e07c.tar.gz
norsk-urskog-registrations-a147a9a6c761d5d867c24bbea09f4d558591e07c.tar.bz2
norsk-urskog-registrations-a147a9a6c761d5d867c24bbea09f4d558591e07c.zip
Fix deploy script.
- link tmp and log dirs from shared_dir to current - create binstubs Tentative upload if init script. commented out for now, it didn't work quite as well as expected.
Diffstat (limited to 'config')
-rw-r--r--config/deploy.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/config/deploy.rb b/config/deploy.rb
index 43ec4c6..9456fef 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -3,11 +3,13 @@ lock '3.6.0'
set :application, 'registration'
set :repo_url, 'https://github.com/snake66/norsk-urskog-registrations.git'
-set :deploy_to, '/home/norskurskog/www/registration'
+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')
+set :linked_dirs, fetch(:linked_dirs, []).push('public/uploads', 'bin', 'log', 'tmp')
+
+set :bundle_binstubs, -> { shared_path.join('bin') }
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
@@ -35,6 +37,19 @@ namespace :deploy do
end
end
+ file 'nu_regform' do |f|
+ template = IO.read('config/deploy/templates/thinrc.erb')
+ res = ERB.new(template).result(binding)
+ IO.write(t.name, res)
+ end
+
+ #after :updated, :upload_init_script => 'nu_regform' 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
# Here we can do anything such as: