changement serveur
This commit is contained in:
parent
f87afd55a4
commit
733f423512
29
config/deploy.rb
Executable file → Normal file
29
config/deploy.rb
Executable file → Normal file
@ -1,5 +1,5 @@
|
|||||||
set :application, 'negos_app'
|
set :application, 'negos_app'
|
||||||
set :domain, 'negos-pro.fr'
|
set :domain, 'quartz-www02.sysnove.net'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -12,15 +12,15 @@ set :application, 'negos_app'
|
|||||||
set :rvm_ruby_string, 'ruby-2.1.2'
|
set :rvm_ruby_string, 'ruby-2.1.2'
|
||||||
set :rvm_autolibs_flag, "read-only"
|
set :rvm_autolibs_flag, "read-only"
|
||||||
|
|
||||||
set :bundle_cmd, "/home/#{user}/.rvm/gems/#{rvm_ruby_string}@global/bin/bundle"
|
set :bundle_cmd, "/srv/www/#{user}/.rvm/gems/#{rvm_ruby_string}@global/bin/bundle"
|
||||||
set :bundle_dir, "/home/#{user}/.rvm/gems/#{rvm_ruby_string}"
|
set :bundle_dir, "/srv/www/#{user}/.rvm/gems/#{rvm_ruby_string}"
|
||||||
set :use_sudo, false
|
set :use_sudo, false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set :deploy_to, "/home/#{user}/#{application}/"
|
set :deploy_to, "/srv/www/#{user}/#{application}/"
|
||||||
set :deploy_via, :remote_cache
|
set :deploy_via, :remote_cache
|
||||||
|
|
||||||
set :normalize_asset_timestamps, false
|
set :normalize_asset_timestamps, false
|
||||||
@ -72,27 +72,28 @@ set :application, 'negos_app'
|
|||||||
run "ln -s #{deploy_to}shared/storage/public #{current_path}/public/public_medias"
|
run "ln -s #{deploy_to}shared/storage/public #{current_path}/public/public_medias"
|
||||||
|
|
||||||
|
|
||||||
run "ln -s #{deploy_to}shared/pdf #{current_path}/pdf"
|
|
||||||
|
|
||||||
|
|
||||||
run "ln -s #{deploy_to}shared/production.sqlite3 #{current_path}/db/production.sqlite3"
|
run "ln -s #{deploy_to}shared/production.sqlite3 #{current_path}/db/production.sqlite3"
|
||||||
|
|
||||||
sudo "cp #{current_path}/config/unicorn_init_d /etc/init.d/#{application}"
|
sudo "cp #{current_path}/config/env_init #{deploy_to}env_init"
|
||||||
|
|
||||||
|
sudo "sudo systemctl enable quartz_app@#{application}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sudo "chmod +x /etc/init.d/#{application}"
|
|
||||||
sudo "update-rc.d #{application} defaults "
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
task :start do
|
task :start do
|
||||||
sudo "service #{application} start"
|
sudo "systemctl start quartz_app@#{application}"
|
||||||
end
|
end
|
||||||
task :stop do
|
task :stop do
|
||||||
run "service #{application} stop"
|
sudo "systemctl stop quartz_app@#{application}"
|
||||||
end
|
end
|
||||||
task :restart do
|
task :restart do
|
||||||
sudo "service #{application} restart"
|
sudo "systemctl stop quartz_app@#{application}"
|
||||||
|
sudo "systemctl start quartz_app@#{application}"
|
||||||
end
|
end
|
||||||
|
|
||||||
task :reload_nginx do
|
task :reload_nginx do
|
||||||
@ -141,3 +142,5 @@ set :application, 'negos_app'
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
6
config/env_init
Normal file
6
config/env_init
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
APP_RUBY=2.1.2
|
||||||
|
ENV=production
|
||||||
|
APP_ROOT=/srv/www/web/negos_app/current/
|
||||||
|
GEM_HOME=/srv/www/web/.rvm/gems/ruby-$APP_RUBY
|
||||||
|
UNICORN_OPTS="-D -E ${ENV} -c ${APP_ROOT}/config/unicorn.rb"
|
||||||
|
|
@ -1,11 +1,11 @@
|
|||||||
upstream negos_app_unicorn {
|
upstream negos_app_unicorn {
|
||||||
server unix:/home/web/negos_app/shared/unicorn.sock fail_timeout=0;
|
server unix:/srv/www/web/negos_app/shared/unicorn.sock fail_timeout=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name negos.pro negos-pro.fr commander.vouisstar.fr;
|
server_name negos.pro negos-pro.fr commander.vouisstar.fr negos.quartz.xyz;
|
||||||
root /home/web/negos_app/current/public;
|
root /srv/www/web/negos_app/current/public;
|
||||||
try_files $uri/index.html $uri @unicorn;
|
try_files $uri/index.html $uri @unicorn;
|
||||||
|
|
||||||
location @unicorn {
|
location @unicorn {
|
||||||
|
12
config/unicorn.rb
Executable file → Normal file
12
config/unicorn.rb
Executable file → Normal file
@ -1,10 +1,10 @@
|
|||||||
@rails_app = "negos_app"
|
@rails_app = "negos_app"
|
||||||
|
|
||||||
working_directory "/home/web/#{@rails_app}/current"
|
working_directory "/srv/www/web/#{@rails_app}/current"
|
||||||
pid "/home/web/#{@rails_app}/shared/unicorn.pid"
|
pid "/srv/www/web/#{@rails_app}/shared/unicorn.pid"
|
||||||
stderr_path "/home/web/#{@rails_app}/shared/log/unicorn.log"
|
stderr_path "/srv/www/web/#{@rails_app}/shared/log/unicorn.log"
|
||||||
stdout_path "/home/web/#{@rails_app}/shared/log/unicorn.log"
|
stdout_path "/srv/www/web/#{@rails_app}/shared/log/unicorn.log"
|
||||||
|
|
||||||
listen "/home/web/#{@rails_app}/shared/unicorn.sock"
|
listen "/srv/www/web/#{@rails_app}/shared/tmp/unicorn.sock"
|
||||||
worker_processes 2
|
worker_processes 2
|
||||||
timeout 30
|
timeout 600
|
||||||
|
@ -7,11 +7,11 @@ set -e
|
|||||||
# Change these to match your app:
|
# Change these to match your app:
|
||||||
APP_NAME=negos_app
|
APP_NAME=negos_app
|
||||||
APP_RUBY=2.1.2
|
APP_RUBY=2.1.2
|
||||||
APP_ROOT="/home/web/negos_app/current"
|
APP_ROOT="/srv/www/web/negos_app/current"
|
||||||
PID="/home/web/negos_app/shared/unicorn.pid"
|
PID="/srv/www/web/negos_app/shared/unicorn.pid"
|
||||||
ENV=production
|
ENV=production
|
||||||
|
|
||||||
GEM_HOME="/home/web/.rvm/gems/ruby-$APP_RUBY"
|
GEM_HOME="/srv/www/web/.rvm/gems/ruby-$APP_RUBY"
|
||||||
|
|
||||||
UNICORN_OPTS="-D -E $ENV -c $APP_ROOT/config/unicorn.rb"
|
UNICORN_OPTS="-D -E $ENV -c $APP_ROOT/config/unicorn.rb"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user