suite
This commit is contained in:
parent
eef3db88bc
commit
75d0db98d3
@ -1,28 +1,26 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
require "rvm/capistrano"
|
||||
require 'bundler/capistrano'
|
||||
|
||||
|
||||
set :application, 'pic_vert_app'
|
||||
set :domain, 'new2.lepicvert.org'
|
||||
set :domain, 'quartz-www02.sysnove.net'
|
||||
|
||||
|
||||
|
||||
set :user, 'web'
|
||||
set :scm_user, "git"
|
||||
set :scm_host, "quartz.snlab.fr"
|
||||
|
||||
|
||||
|
||||
|
||||
set :rvm_ruby_string, 'ruby-2.1.2@picvert'
|
||||
set :rvm_ruby_string, 'ruby-2.1.2'
|
||||
set :rvm_autolibs_flag, "read-only"
|
||||
|
||||
#set :bundle_cmd, "/home/#{user}/.rvm/gems/#{rvm_ruby_string}/bin/bundle"
|
||||
set :bundle_dir, "/home/#{user}/.rvm/gems/#{rvm_ruby_string}"
|
||||
set :bundle_cmd, "/srv/www/#{user}/.rvm/gems/#{rvm_ruby_string}@global/bin/bundle"
|
||||
set :bundle_dir, "/srv/www/#{user}/.rvm/gems/#{rvm_ruby_string}"
|
||||
set :use_sudo, false
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set :deploy_to, "/home/#{user}/#{application}/"
|
||||
set :deploy_to, "/srv/www/#{user}/#{application}/"
|
||||
set :deploy_via, :remote_cache
|
||||
|
||||
set :normalize_asset_timestamps, false
|
||||
@ -35,14 +33,15 @@ role :db, domain, :primary => true
|
||||
|
||||
set :scm, :git
|
||||
|
||||
set :repository, "git@git.nicolasbally.com:root/pic_vert_app.git"
|
||||
set :repository, "#{scm_user}@#{scm_host}:nicolas/#{application}.git"
|
||||
|
||||
set :branch, "master"
|
||||
|
||||
default_run_options[:pty] = true
|
||||
|
||||
|
||||
|
||||
require "rvm/capistrano"
|
||||
require 'bundler/capistrano'
|
||||
|
||||
|
||||
|
||||
@ -72,24 +71,29 @@ namespace :deploy do
|
||||
|
||||
run "ln -s #{deploy_to}shared/storage/public #{current_path}/public/public_medias"
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
task :start do
|
||||
sudo "service #{application} start"
|
||||
sudo "systemctl start quartz_app@#{application}"
|
||||
end
|
||||
task :stop do
|
||||
run "service #{application} stop"
|
||||
sudo "systemctl stop quartz_app@#{application}"
|
||||
end
|
||||
task :restart do
|
||||
sudo "service #{application} restart"
|
||||
sudo "systemctl stop quartz_app@#{application}"
|
||||
sudo "systemctl start quartz_app@#{application}"
|
||||
end
|
||||
|
||||
task :reload_nginx do
|
||||
@ -137,3 +141,6 @@ after "deploy", "deploy:cleanup"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
7
config/env_init
Normal file
7
config/env_init
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
APP_RUBY=2.1.2
|
||||
ENV=production
|
||||
APP_ROOT=/srv/www/web/pic_vert_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 pic_vert_app_unicorn {
|
||||
server unix:/home/web/pic_vert_app/shared/tmp/unicorn.sock fail_timeout=0;
|
||||
server unix:/srv/www/web/pic_vert_app/shared/tmp/unicorn.sock fail_timeout=0;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name lepicvert.org;
|
||||
root /home/web/pic_vert_app/current/public;
|
||||
root /srv/www/web/pic_vert_app/current/public;
|
||||
try_files $uri/index.html $uri @unicorn;
|
||||
|
||||
location @unicorn {
|
||||
@ -23,7 +23,7 @@ server {
|
||||
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name www.lepicvert.org new2.lepicvert.org new.lepicvert.org www.lepicvert.asso.fr lepicvert.asso.fr;
|
||||
rewrite ^(.*) http://lepicvert.org$1 permanent;
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
@rails_app = "pic_vert_app"
|
||||
|
||||
working_directory "/home/web/#{@rails_app}/current"
|
||||
pid "/home/web/#{@rails_app}/shared/unicorn.pid"
|
||||
stderr_path "/home/web/#{@rails_app}/shared/log/unicorn.log"
|
||||
stdout_path "/home/web/#{@rails_app}/shared/log/unicorn.log"
|
||||
working_directory "/srv/www/web/#{@rails_app}/current"
|
||||
pid "/srv/www/web/#{@rails_app}/shared/unicorn.pid"
|
||||
stderr_path "/srv/www/web/#{@rails_app}/shared/log/unicorn.log"
|
||||
stdout_path "/srv/www/web/#{@rails_app}/shared/log/unicorn.log"
|
||||
|
||||
listen "/home/web/#{@rails_app}/shared/tmp/unicorn.sock"
|
||||
listen "/srv/www/web/#{@rails_app}/shared/tmp/unicorn.sock"
|
||||
worker_processes 2
|
||||
timeout 600
|
||||
|
@ -6,12 +6,12 @@ set -e
|
||||
|
||||
# Change these to match your app:
|
||||
APP_NAME=pic_vert_app
|
||||
APP_RUBY=2.1.2@picvert
|
||||
APP_ROOT="/home/web/pic_vert_app/current"
|
||||
PID="/home/web/pic_vert_app/shared/unicorn.pid"
|
||||
APP_RUBY=ruby-2.1.2
|
||||
APP_ROOT="/srv/www/web/pic_vert_app/current"
|
||||
PID="/srv/www/web/pic_vert_app/shared/unicorn.pid"
|
||||
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"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user