suite
220
config/deploy.rb
@ -1,163 +1,147 @@
|
|||||||
|
set :application, 'base_photo_app'
|
||||||
|
set :domain, 'quartz-www02.sysnove.net'
|
||||||
|
|
||||||
# ajouter shared_path, modifier liens symboliques & mkdir
|
|
||||||
# changer unicorn_init_d
|
|
||||||
# changer unicorn.rb
|
|
||||||
# changer nginx.conf
|
|
||||||
set :application, 'base_photo_app'
|
|
||||||
set :domain, 'basephoto.one-voice.fr'
|
|
||||||
|
|
||||||
set :user, 'web'
|
|
||||||
set :scm_user, "git"
|
|
||||||
set :scm_host, "gitlab.quartz.xyz"
|
|
||||||
|
|
||||||
set :rvm_ruby_string, 'ruby-2.1.2'
|
set :user, 'web'
|
||||||
set :rvm_autolibs_flag, "read-only"
|
set :scm_user, "git"
|
||||||
|
set :scm_host, "quartz.snlab.fr"
|
||||||
|
|
||||||
set :bundle_cmd, "/home/#{user}/.rvm/gems/#{rvm_ruby_string}@global/bin/bundle"
|
|
||||||
set :bundle_dir, "/home/#{user}/.rvm/gems/#{rvm_ruby_string}"
|
|
||||||
set :use_sudo, false
|
set :rvm_ruby_string, 'ruby-2.1.2'
|
||||||
|
set :rvm_autolibs_flag, "read-only"
|
||||||
|
|
||||||
|
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 :deploy_via, :remote_cache
|
set :normalize_asset_timestamps, false
|
||||||
|
|
||||||
set :normalize_asset_timestamps, false
|
set :rails_env, "production"
|
||||||
|
|
||||||
set :rails_env, "production"
|
role :app, domain
|
||||||
|
role :web, domain
|
||||||
|
role :db, domain, :primary => true
|
||||||
|
|
||||||
role :app, domain
|
set :scm, :git
|
||||||
role :web, domain
|
|
||||||
role :db, domain, :primary => true
|
|
||||||
|
|
||||||
set :scm, :git
|
set :repository, "#{scm_user}@#{scm_host}:nicolas/#{application}.git"
|
||||||
|
|
||||||
set :repository, "#{scm_user}@#{scm_host}:nbally/#{application}.git"
|
set :branch, "master"
|
||||||
|
|
||||||
set :branch, "master"
|
default_run_options[:pty] = true
|
||||||
|
|
||||||
|
|
||||||
set :shared_path, "/media/bigone/shareds/#{application}"
|
require "rvm/capistrano"
|
||||||
|
require 'bundler/capistrano'
|
||||||
default_run_options[:pty] = true
|
|
||||||
|
|
||||||
|
|
||||||
require "rvm/capistrano"
|
|
||||||
require 'bundler/capistrano'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
load 'deploy/assets'
|
load 'deploy/assets'
|
||||||
|
|
||||||
namespace :deploy do
|
namespace :deploy do
|
||||||
|
|
||||||
# namespace :assets do
|
# namespace :assets do
|
||||||
# task :precompile, :roles => :web, :except => { :no_release => true } do
|
# task :precompile, :roles => :web, :except => { :no_release => true } do
|
||||||
# from = source.next_revision(current_revision)
|
# from = source.next_revision(current_revision)
|
||||||
# if releases.length <= 1 || capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
|
# if releases.length <= 1 || capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
|
||||||
# run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
|
# run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
|
||||||
# else
|
# else
|
||||||
# logger.info "Skipping asset pre-compilation because there were no asset changes"
|
# logger.info "Skipping asset pre-compilation because there were no asset changes"
|
||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
desc "Symlink shared config files"
|
||||||
|
task :symlink_config_files do
|
||||||
|
|
||||||
|
|
||||||
|
run "ln -s #{deploy_to}shared/storage/private #{current_path}/private_medias"
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
desc "Symlink shared config files"
|
sudo "cp #{current_path}/config/env_init #{deploy_to}env_init"
|
||||||
task :symlink_config_files do
|
|
||||||
|
|
||||||
|
sudo "sudo systemctl enable quartz_app@#{application}"
|
||||||
|
|
||||||
run "ln -s #{shared_path}/private #{current_path}/private_medias"
|
|
||||||
run "ln -s #{shared_path}/pdf #{current_path}/pdf"
|
|
||||||
run "ln -s #{shared_path}/public #{current_path}/public/public_medias"
|
|
||||||
run "ln -s #{shared_path}/production.sqlite3 #{current_path}/db/production.sqlite3"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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
|
|
||||||
sudo "service #{application} start"
|
|
||||||
end
|
|
||||||
task :stop do
|
|
||||||
run "service #{application} stop"
|
|
||||||
end
|
|
||||||
task :restart do
|
|
||||||
sudo "service #{application} restart"
|
|
||||||
end
|
|
||||||
|
|
||||||
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 :import_prod_images do
|
|
||||||
run "cd #{deploy_to}current && bundle exec rake image_files:import_images RAILS_ENV=#{rails_env}"
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
task :db_create do
|
|
||||||
run "cd #{deploy_to}current && bundle exec rake db:create RAILS_ENV=#{rails_env}"
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
task :seeds do
|
|
||||||
run "cd #{deploy_to}current && bundle exec rake db:seed RAILS_ENV=#{rails_env}"
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
task :create_files_folders do
|
|
||||||
|
|
||||||
# run "mkdir #{deploy_to}shared/storage"
|
|
||||||
# run "mkdir #{deploy_to}shared/storage/private"
|
|
||||||
# run "mkdir #{deploy_to}shared/storage/public"
|
|
||||||
|
|
||||||
run "mkdir #{shared_path}/private"
|
|
||||||
run "mkdir #{shared_path}/public"
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
#before 'deploy:setup', 'rvm:install_rvm' # install RVM
|
|
||||||
#before 'deploy:setup', 'rvm:install_ruby' # install Ruby and create gemset, OR:
|
task :start do
|
||||||
#before 'deploy:setup', 'rvm:create_gemset' # only create gemset
|
sudo "systemctl start quartz_app@#{application}"
|
||||||
|
end
|
||||||
|
task :stop do
|
||||||
|
sudo "systemctl stop quartz_app@#{application}"
|
||||||
|
end
|
||||||
|
task :restart do
|
||||||
|
sudo "systemctl stop quartz_app@#{application}"
|
||||||
|
sudo "systemctl start quartz_app@#{application}"
|
||||||
|
end
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
after "deploy:setup", "deploy:create_files_folders"
|
|
||||||
|
|
||||||
#after "deploy:restart", "deploy:cleanup"
|
task :seeds do
|
||||||
|
run "cd #{deploy_to}current && rake db:seed RAILS_ENV=#{rails_env}"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
before "deploy:restart", "deploy:symlink_config_files"
|
task :create_files_folders do
|
||||||
|
|
||||||
after "deploy", "deploy:cleanup"
|
|
||||||
|
|
||||||
|
run "mkdir #{deploy_to}shared/storage"
|
||||||
|
run "mkdir #{deploy_to}shared/storage/private"
|
||||||
|
run "mkdir #{deploy_to}shared/storage/public"
|
||||||
|
run "mkdir #{deploy_to}shared/tmp"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
#before 'deploy:setup', 'rvm:install_rvm' # install RVM
|
||||||
|
#before 'deploy:setup', 'rvm:install_ruby' # install Ruby and create gemset, OR:
|
||||||
|
#before 'deploy:setup', 'rvm:create_gemset' # only create gemset
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
after "deploy:setup", "deploy:create_files_folders"
|
||||||
|
|
||||||
|
#after "deploy:restart", "deploy:cleanup"
|
||||||
|
|
||||||
|
|
||||||
|
before "deploy:restart", "deploy:symlink_config_files"
|
||||||
|
|
||||||
|
after "deploy", "deploy:cleanup"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
6
config/env_init
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
APP_RUBY=2.1.2
|
||||||
|
ENV=production
|
||||||
|
APP_ROOT=/srv/www/web/base_photo_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 base_photo_app_unicorn {
|
upstream base_photo_app_unicorn {
|
||||||
server unix:/home/web/base_photo_app/unicorn.sock fail_timeout=0;
|
server unix:/srv/www/web/base_photo_app/shared/tmp/unicorn.sock fail_timeout=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen [::]:80;
|
||||||
server_name basephoto.one-voice.fr;
|
server_name basephoto.one-voice.fr basephoto.quartz.xyz;
|
||||||
root /home/web/base_photo_app/current/public;
|
root /srv/www/web/base_photo_app/current/public;
|
||||||
try_files $uri/index.html $uri @unicorn;
|
try_files $uri/index.html $uri @unicorn;
|
||||||
|
|
||||||
location @unicorn {
|
location @unicorn {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
@rails_app = "base_photo_app"
|
@rails_app = "base_photo_app"
|
||||||
|
|
||||||
working_directory "/home/web/#{@rails_app}/current"
|
working_directory "/srv/www/web/#{@rails_app}/current"
|
||||||
pid "/home/web/#{@rails_app}/unicorn.pid"
|
pid "/srv/www/web/#{@rails_app}/shared/unicorn.pid"
|
||||||
stderr_path "/media/bigone/shareds/#{@rails_app}/unicorn.log"
|
stderr_path "/srv/www/web/#{@rails_app}/shared/log/unicorn.log"
|
||||||
stdout_path "/media/bigone/shareds/#{@rails_app}/unicorn.log"
|
stdout_path "/srv/www/web/#{@rails_app}/shared/log/unicorn.log"
|
||||||
|
|
||||||
listen "/home/web/#{@rails_app}/unicorn.sock"
|
listen "/srv/www/web/#{@rails_app}/shared/tmp/unicorn.sock"
|
||||||
worker_processes 2
|
worker_processes 2
|
||||||
timeout 2000
|
timeout 600
|
||||||
|
@ -7,11 +7,11 @@ set -e
|
|||||||
# Change these to match your app:
|
# Change these to match your app:
|
||||||
APP_NAME=base_photo_app
|
APP_NAME=base_photo_app
|
||||||
APP_RUBY=2.1.2
|
APP_RUBY=2.1.2
|
||||||
APP_ROOT="/home/web/base_photo_app/current"
|
APP_ROOT="/srv/www/web/base_photo_app/current"
|
||||||
PID="/home/web/base_photo_app/unicorn.pid"
|
PID="/srv/www/web/base_photo_app/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"
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 263 KiB |
Before Width: | Height: | Size: 247 KiB |
Before Width: | Height: | Size: 253 KiB |
Before Width: | Height: | Size: 236 KiB |
Before Width: | Height: | Size: 212 KiB |
Before Width: | Height: | Size: 212 KiB |
Before Width: | Height: | Size: 271 KiB |
Before Width: | Height: | Size: 380 KiB |
Before Width: | Height: | Size: 588 KiB |
Before Width: | Height: | Size: 423 KiB |
Before Width: | Height: | Size: 253 KiB |
Before Width: | Height: | Size: 348 KiB |
Before Width: | Height: | Size: 234 KiB |
Before Width: | Height: | Size: 172 KiB |
Before Width: | Height: | Size: 171 KiB |
Before Width: | Height: | Size: 209 KiB |
Before Width: | Height: | Size: 187 KiB |
Before Width: | Height: | Size: 190 KiB |
Before Width: | Height: | Size: 262 KiB |
Before Width: | Height: | Size: 344 KiB |
Before Width: | Height: | Size: 170 KiB |
Before Width: | Height: | Size: 442 KiB |
Before Width: | Height: | Size: 225 KiB |
Before Width: | Height: | Size: 223 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 654 KiB |
Before Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 610 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 420 KiB |
Before Width: | Height: | Size: 312 KiB |
Before Width: | Height: | Size: 316 KiB |
Before Width: | Height: | Size: 391 KiB |
Before Width: | Height: | Size: 349 KiB |
Before Width: | Height: | Size: 351 KiB |
Before Width: | Height: | Size: 218 KiB |
Before Width: | Height: | Size: 298 KiB |
Before Width: | Height: | Size: 312 KiB |
Before Width: | Height: | Size: 481 KiB |
Before Width: | Height: | Size: 412 KiB |
Before Width: | Height: | Size: 417 KiB |
BIN
public/fond4.pxm
Before Width: | Height: | Size: 441 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 545 KiB |
Before Width: | Height: | Size: 433 KiB |
Before Width: | Height: | Size: 971 KiB |
Before Width: | Height: | Size: 567 KiB |
Before Width: | Height: | Size: 598 KiB |
Before Width: | Height: | Size: 751 KiB |
Before Width: | Height: | Size: 375 KiB |
Before Width: | Height: | Size: 496 KiB |
Before Width: | Height: | Size: 768 KiB |
Before Width: | Height: | Size: 144 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 4.2 MiB |
Before Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 172 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 324 KiB |
Before Width: | Height: | Size: 362 KiB |
Before Width: | Height: | Size: 292 KiB |
Before Width: | Height: | Size: 387 KiB |
Before Width: | Height: | Size: 424 KiB |
Before Width: | Height: | Size: 440 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 455 KiB |
Before Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 427 KiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 327 KiB |
Before Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 1.1 MiB |