diff --git a/config/deploy.rb b/config/deploy.rb index 4d8cef5..b23a044 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -71,6 +71,15 @@ set :application, 'blog_perso_app' namespace :deploy do + + task :reload_nginx do + + sudo "rm -rf /etc/nginx/sites-enabled/#{application}" + sudo "ln -s #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application} " + + sudo "service nginx reload" + end + task :bundle_gems do run "cd #{release_path} && bundle install" end @@ -80,6 +89,11 @@ set :application, 'blog_perso_app' run "ln -s #{deploy_to}shared/storage/private #{release_path}/private_medias" run "rm -rf #{release_path}/public/public_medias" run "ln -s #{deploy_to}shared/storage/public #{release_path}/public/public_medias" + + sudo "cp #{current_path}/config/unicorn_init_d /etc/init.d/#{application}" + + sudo "chmod +x /etc/init.d/#{application}" + sudo "update-rc.d #{application} defaults " end task :start do diff --git a/config/unicorn_init_d b/config/unicorn_init_d index 2a337b4..a8fd61e 100755 --- a/config/unicorn_init_d +++ b/config/unicorn_init_d @@ -5,10 +5,10 @@ set -u set -e # Change these to match your app: -APP_NAME=cs_app +APP_NAME=blog_perso_app APP_RUBY=2.1.2 -APP_ROOT="/home/web/cs_app/current" -PID="/home/web/cs_app/shared/unicorn.pid" +APP_ROOT="/home/web/blog_perso_app/current" +PID="/home/web/blog_perso_app/shared/tmp/unicorn.pid" ENV=production GEM_HOME="/home/web/.rvm/gems/ruby-$APP_RUBY"