removes capistrano template configuration
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
<VirtualHost *:80>
|
||||
|
||||
ServerName yourdomain.com
|
||||
ServerAlias www.yourdomain.com
|
||||
ServerAdmin webmaster@localhost
|
||||
|
||||
DocumentRoot /path/to/deploy_to/current/public
|
||||
|
||||
# RailsEnv production
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/yourdomain.error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/yourdomain.access.log combined
|
||||
|
||||
<Directory "/path/to/deploy_to/current/public">
|
||||
Options FollowSymLinks
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
</VirtualHost>
|
||||
@@ -1,31 +0,0 @@
|
||||
<VirtualHost *:80>
|
||||
|
||||
ServerAdmin admin@yourdomain.com
|
||||
ServerName yourdomain.com
|
||||
ServerAlias www.yourdomain.com
|
||||
|
||||
DocumentRoot /path/to/deploy_to/current/public
|
||||
|
||||
RewriteEngine On
|
||||
|
||||
<Proxy balancer://unicornservers>
|
||||
BalancerMember http://127.0.0.1:5000
|
||||
</Proxy>
|
||||
|
||||
# Redirect all non-static requests to thin
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L]
|
||||
|
||||
ProxyPass / balancer://unicornservers/
|
||||
ProxyPassReverse / balancer://unicornservers/
|
||||
ProxyPreserveHost on
|
||||
|
||||
<Proxy *>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</Proxy>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/yourdomain.error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/yourdomain.access.log combined
|
||||
|
||||
</VirtualHost>
|
||||
@@ -1,96 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: unicorn
|
||||
# Required-Start: $local_fs $remote_fs $network $syslog
|
||||
# Required-Stop: $local_fs $remote_fs $network $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: starts the unicorn web server
|
||||
# Description: starts unicorn
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
|
||||
TIMEOUT=${TIMEOUT-60}
|
||||
APP_ROOT=<%= current_path %>
|
||||
PID_DIR=$APP_ROOT/tmp/pids
|
||||
PID=$PID_DIR/unicorn.pid
|
||||
CMD="cd $APP_ROOT; bundle exec unicorn -D -c /path/to/shared/config/unicorn.rb -E production"
|
||||
AS_USER=deploy
|
||||
set -u
|
||||
|
||||
OLD_PIN="$PID.oldbin"
|
||||
|
||||
sig () {
|
||||
test -s "$PID" && kill -$1 `cat $PID`
|
||||
}
|
||||
|
||||
oldsig () {
|
||||
test -s $OLD_PIN && kill -$1 `cat $OLD_PIN`
|
||||
}
|
||||
|
||||
workersig () {
|
||||
workerpid="$APP_ROOT/tmp/pids/unicorn.$2.pid"
|
||||
|
||||
test -s "$workerpid" && kill -$1 `cat $workerpid`
|
||||
}
|
||||
|
||||
run () {
|
||||
if [ "$(id -un)" = "$AS_USER" ]; then
|
||||
eval $1
|
||||
else
|
||||
su -c "$1" - $AS_USER
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
sig 0 && echo >&2 "Already running" && exit 0
|
||||
run "$CMD"
|
||||
;;
|
||||
stop)
|
||||
sig QUIT && exit 0
|
||||
echo >&2 "Not running"
|
||||
;;
|
||||
force-stop)
|
||||
sig TERM && exit 0
|
||||
echo >&2 "Not running"
|
||||
;;
|
||||
kill_worker)
|
||||
workersig QUIT $2 && exit 0
|
||||
echo >&2 "Worker not running"
|
||||
;;
|
||||
restart|reload)
|
||||
sig USR2 && echo reloaded OK && exit 0
|
||||
echo >&2 "Couldn't reload, starting '$CMD' instead"
|
||||
run "$CMD"
|
||||
;;
|
||||
upgrade)
|
||||
if sig USR2 && sleep 2 && sig 0 && oldsig QUIT
|
||||
then
|
||||
n=$TIMEOUT
|
||||
while test -s $OLD_PIN && test $n -ge 0
|
||||
do
|
||||
printf '.' && sleep 1 && n=$(( $n - 1 ))
|
||||
done
|
||||
echo
|
||||
|
||||
if test $n -lt 0 && test -s $OLD_PIN
|
||||
then
|
||||
echo >&2 "$OLD_PIN still exists after $TIMEOUT seconds"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
echo >&2 "Couldn't upgrade, starting '$CMD' instead"
|
||||
run "$CMD"
|
||||
;;
|
||||
reopen-logs)
|
||||
sig USR1
|
||||
;;
|
||||
*)
|
||||
echo >&2 "Usage: $0 <start|stop|restart|upgrade|force-stop|reopen-logs>"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -1,10 +0,0 @@
|
||||
<%= fetch(:rails_env) %>:
|
||||
adapter: postgresql
|
||||
timeout: 5000
|
||||
encoding: unicode
|
||||
reconnect: false
|
||||
database: <%= "#{fetch(:application)}" %>
|
||||
pool: 5
|
||||
username:
|
||||
password:
|
||||
host: <%= fetch(:db_server) %>
|
||||
@@ -1,11 +0,0 @@
|
||||
<%= fetch(:deploy_to) %>/shared/log/*.log {
|
||||
daily
|
||||
missingok
|
||||
rotate 52
|
||||
compress
|
||||
delaycompress
|
||||
notifempty
|
||||
sharedscripts
|
||||
endscript
|
||||
copytruncate
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<%= fetch(:rails_env) %>:
|
||||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
||||
twitter_key: <%= ENV["TWITTER_KEY"] %>
|
||||
twitter_secret: <%= ENV["TWITTER_SECRET"] %>
|
||||
facebook_key: <%= ENV["FACEBOOK_KEY"] %>
|
||||
facebook_secret: <%= ENV["FACEBOOK_SECRET"] %>
|
||||
google_oauth2_key: <%= ENV["GOOGLE_KEY"] %>
|
||||
google_oauth2_secret: <%= ENV["GOOGLE_SECRET"] %>
|
||||
server_name: <%= fetch(:server_name) %>
|
||||
@@ -1,2 +0,0 @@
|
||||
<%= fetch(:rails_env) %>:
|
||||
:concurrency: <%= fetch(:sidekiq_concurrency, 5) %>
|
||||
@@ -1,42 +0,0 @@
|
||||
root = "<%= current_path %>"
|
||||
working_directory root
|
||||
pid "#{root}/tmp/pids/unicorn.pid"
|
||||
stderr_path "#{root}/log/unicorn.log"
|
||||
stdout_path "#{root}/log/unicorn.log"
|
||||
|
||||
listen 5000
|
||||
#listen "/tmp/unicorn.<%= fetch(:application) %>.sock"
|
||||
worker_processes 4
|
||||
timeout 40
|
||||
preload_app true
|
||||
|
||||
# Force unicorn to look at the Gemfile in the current_path
|
||||
# otherwise once we've first started a master process, it
|
||||
# will always point to the first one it started.
|
||||
before_exec do |server|
|
||||
ENV['BUNDLE_GEMFILE'] = "<%= current_path %>/Gemfile"
|
||||
end
|
||||
|
||||
before_fork do |server, worker|
|
||||
defined?(ActiveRecord::Base) and
|
||||
ActiveRecord::Base.connection.disconnect!
|
||||
# Quit the old unicorn process
|
||||
old_pid = "#{server.config[:pid]}.oldbin"
|
||||
if File.exists?(old_pid) && server.pid != old_pid
|
||||
puts "We've got an old pid and server pid is not the old pid"
|
||||
begin
|
||||
Process.kill("QUIT", File.read(old_pid).to_i)
|
||||
puts "killing master process (good thing tm)"
|
||||
rescue Errno::ENOENT, Errno::ESRCH
|
||||
puts "unicorn master already killed"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
after_fork do |server, worker|
|
||||
port = 5000 + worker.nr
|
||||
child_pid = server.config[:pid].sub('.pid', ".#{port}.pid")
|
||||
system("echo #{Process.pid} > #{child_pid}")
|
||||
defined?(ActiveRecord::Base) and
|
||||
ActiveRecord::Base.establish_connection
|
||||
end
|
||||
Reference in New Issue
Block a user