From a147a9a6c761d5d867c24bbea09f4d558591e07c Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 22 Sep 2016 21:19:30 +0200 Subject: 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. --- config/deploy.rb | 19 +++++++++++++++++-- 1 file 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: -- cgit v1.2.3