2018-08-07 15:13:20 +08:00
|
|
|
#!/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
|
|
|
|
|
2018-08-07 16:20:08 +08:00
|
|
|
ENV["UNICORN_PORT"] ||= "9292"
|
|
|
|
ENV["UNICORN_SIDEKIQS"] ||= "1"
|
2018-08-07 16:27:44 +08:00
|
|
|
|
2018-08-07 15:13:20 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
load Gem.bin_path('unicorn', 'unicorn')
|