diff --git a/config/deploy.rb b/config/deploy.rb index f06f648..fcf1c05 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -27,7 +27,7 @@ role :web, domain role :db, domain, :primary => true set :scm, :git -set :repository, "git@box1.quartz-agence.com:#{application}.git" +set :repository, "git@git.nicolasbally.com:root/#{application}.git" set :branch, "master" default_run_options[:pty] = true diff --git a/config/nginx.conf b/config/nginx.conf index 9880c50..70500ba 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -1,5 +1,5 @@ upstream maisonarbre_app_unicorn { - server unix:/home/web/maisonarbre_app/shared/tmp/unicorn.sock fail_timeout=0; + server unix:/home/web/maisonarbre_app/shared/unicorn.sock fail_timeout=0; } server { diff --git a/config/unicorn.rb b/config/unicorn.rb index 55bde87..f777416 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -5,6 +5,6 @@ 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" -listen "/home/web/#{@rails_app}/shared/tmp/unicorn.sock" +listen "/home/web/#{@rails_app}/shared/unicorn.sock" worker_processes 2 timeout 30 \ No newline at end of file diff --git a/config/unicorn_init_d b/config/unicorn_init_d new file mode 100755 index 0000000..acc3d84 --- /dev/null +++ b/config/unicorn_init_d @@ -0,0 +1,64 @@ +#!/bin/bash + + +set -u +set -e + +# Change these to match your app: +APP_NAME=maisonarbre_app +APP_RUBY=1.9.3-p0 +APP_ROOT="/home/web/maisonarbre_app/current" +PID="/home/web/maisonarbre_app/shared/unicorn.pid" +ENV=production + +GEM_HOME="/home/web/.rvm/gems/ruby-$APP_RUBY" + +UNICORN_OPTS="-D -E $ENV -c $APP_ROOT/config/unicorn.rb" + +SET_PATH="cd $APP_ROOT; rvm $APP_RUBY" +CMD="$SET_PATH; unicorn $UNICORN_OPTS" + +old_pid="$PID.oldbin" + +cd $APP_ROOT || exit 1 + +sig () { + test -s "$PID" && kill -$1 `cat $PID` +} + +oldsig () { + test -s $old_pid && kill -$1 `cat $old_pid` +} + +case ${1-help} in + start) + sig 0 && echo >&2 "Already running" && exit 0 + su - web -c "$CMD" + ;; + stop) + sig QUIT && exit 0 + echo >&2 "Not running" + ;; + force-stop) + sig TERM && exit 0 + echo >&2 "Not running" + ;; + restart|reload) + sig HUP && echo reloaded OK && exit 0 + echo >&2 "Couldn't reload, starting '$CMD' instead" + su - web -c "$CMD" + ;; + upgrade) + sig USR2 && exit 0 + echo >&2 "Couldn't upgrade, starting '$CMD' instead" + su - web -c "$CMD" + ;; + rotate) + sig USR1 && echo rotated logs OK && exit 0 + echo >&2 "Couldn't rotate logs" && exit 1 + ;; + *) + echo >&2 "Usage: $0 " + exit 1 + ;; +esac \ No newline at end of file