mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: use unicorn in development
This commit also cleans up a bunch of pointless noise each time we boot app - narrative was loading i18n cause redefinition of consts - discourse.rb was loaded twice as was auth - bin/unicorn now does all the smart things and boots unicron in dev - bin/rails s will boot unicorn with no params - remove bin/puma which only causes confusion
This commit is contained in:
29
bin/unicorn
Executable file
29
bin/unicorn
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require 'pathname'
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
||||
Pathname.new(__FILE__).realpath)
|
||||
|
||||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
|
||||
# in development do some fussing around, to automate config
|
||||
if !ARGV.include?("-E") &&
|
||||
!ARGV.include?("--env") &&
|
||||
(ENV["RAILS_ENV"] == "development" || !ENV["RAILS_ENV"])
|
||||
|
||||
ARGV.push("-N")
|
||||
if !ARGV.include?("-c") && !ARGV.include?("--config-file")
|
||||
ARGV.push("-c")
|
||||
ARGV.push(File.expand_path("../../config/unicorn.conf.rb",
|
||||
Pathname.new(__FILE__).realpath))
|
||||
end
|
||||
|
||||
ENV["UNICORN_PORT"] = "9292"
|
||||
|
||||
if !ENV["UNICORN_SIDEKIQS"]
|
||||
ENV["UNICORN_SIDEKIQS"] = "1"
|
||||
end
|
||||
end
|
||||
|
||||
load Gem.bin_path('unicorn', 'unicorn')
|
||||
Reference in New Issue
Block a user