Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venshop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tan Phat Nguyen
venshop
Commits
00db718c
Commit
00db718c
authored
Nov 21, 2014
by
Tan Phat Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deploy unicorn
parent
1088c0c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
config/unicorn/production.rb
+12
-14
No files found.
config/unicorn.rb
→
config/unicorn
/production
.rb
View file @
00db718c
# paths
app_path
=
"/web/training/phatnt/"
app_path
=
'/web/training/phatnt'
working_directory
"
#{
app_path
}
/current"
pid
"
#{
app_path
}
/current/tmp/pids/unicorn.pid"
# listen
listen
"/tmp/unicorn
-www.example.com.socket"
,
:backlog
=>
64
listen
"/tmp/unicorn
.venshop.sock"
# logging
stderr_path
"log/unicorn.stderr.log"
stdout_path
"log/unicorn.stdout.log"
stderr_path
"
#{
app_path
}
/shared/
log/unicorn.stderr.log"
stdout_path
"
#{
app_path
}
/shared/
log/unicorn.stdout.log"
#
workers
worker_processes
3
#workers
worker_processes
1
# use correct Gemfile on restarts
# use
r
correct Gemfile on restarts
before_exec
do
|
server
|
ENV
[
'BUNDLE_GEMFILE'
]
=
"
#{
app_path
}
/current/Gemfile"
end
...
...
@@ -22,20 +21,19 @@ end
preload_app
true
before_fork
do
|
server
,
worker
|
# the following is highly recomended for Rails + "preload_app true"
# as there's no need for the master process to hold a connection
if
defined?
(
ActiveRecord
::
Base
)
ActiveRecord
::
Base
.
connection
.
disconnect!
end
# Before fork
ing, kill the master process that belongs to the .oldbin PID.
# This enables 0 downtime deploys
.
# Before fork
, kill the master process that belongs to the .oldbin PID
# This enables 0 downtime deploys
old_pid
=
"
#{
server
.
config
[
:pid
]
}
.oldbin"
if
File
.
exists?
(
old_pid
)
&&
server
.
pid
!=
old_pid
begin
Process
.
kill
(
"QUIT"
,
File
.
read
(
old_pid
).
to_i
)
Process
.
kill
(
'QUIT'
,
File
.
read
(
old_pid
).
to_i
)
rescue
Errno
::
ENOENT
,
Errno
::
ESRCH
# someone else did our job for us
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment