Skip to content

Commit

Permalink
First version of the manual deployment guide
Browse files Browse the repository at this point in the history
  • Loading branch information
dsander committed Aug 18, 2015
1 parent b88e20d commit 0e4c9be
Show file tree
Hide file tree
Showing 12 changed files with 691 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ deployment/cookbooks
.ruby-gemset
.ruby-version
manifest.yml
config/unicorn.rb
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ end

group :production do
gem 'rack', '> 1.5.0'
gem 'unicorn', '~> 4.9.0'
end

# Platform requirements.
Expand All @@ -145,6 +146,5 @@ end

on_heroku do
gem 'pg'
gem 'unicorn'
gem 'rails_12factor', group: :production
end
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ GEM
kaminari (0.16.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.9.2)
kgio (2.9.3)
kramdown (1.3.3)
launchy (2.4.2)
addressable (~> 2.3)
Expand Down Expand Up @@ -472,7 +472,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)
unicorn (4.8.3)
unicorn (4.9.0)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
Expand Down Expand Up @@ -576,7 +576,7 @@ DEPENDENCIES
tzinfo (>= 1.2.0)
tzinfo-data
uglifier (>= 1.3.0)
unicorn
unicorn (~> 4.9.0)
vcr
webmock (~> 1.17.4)
weibo_2!
Expand Down
20 changes: 17 additions & 3 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
#################
# DEVELOPMENT #
#################

# Procfile for development using the new threaded worker (scheduler, twitter stream and delayed job)
web: bundle exec rails server -b0.0.0.0
jobs: bundle exec rails runner bin/threaded.rb

# Possible Profile configuration for production:
# web: bundle exec unicorn -c config/unicorn/production.rb
# Old version with separate processes (use this if you have issues with the threaded version)
# web: bundle exec rails server
# schedule: bundle exec rails runner bin/schedule.rb
# twitter: bundle exec rails runner bin/twitter_stream.rb
# dj: bundle exec script/delayed_job run

#################
# PRODUCTION #
#################

# Using the threaded worker (consumes less RAM but can run slower)
# web: bundle exec unicorn -c config/unicorn.rb
# jobs: bundle exec rails runner bin/threaded.rb

# Old version with separate processes (use this if you have issues with the threaded version)
# web: bundle exec rails server -b0.0.0.0
# web: bundle exec unicorn -c config/unicorn.rb
# schedule: bundle exec rails runner bin/schedule.rb
# twitter: bundle exec rails runner bin/twitter_stream.rb
# dj: bundle exec script/delayed_job run
35 changes: 35 additions & 0 deletions config/unicorn.rb.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
wd = "/home/huginn/huginn"

app_path = wd

worker_processes 2
preload_app true
timeout 180
listen "#{wd}/tmp/sockets/unicorn.socket"

working_directory app_path

rails_env = ENV['RAILS_ENV'] || 'production'

# Log everything to one file
stderr_path "log/unicorn.log"
stdout_path "log/unicorn.log"

# Set master PID location
pid "#{wd}/tmp/pids/unicorn.pid"

before_fork do |server, worker|
ActiveRecord::Base.connection.disconnect!
old_pid = "#{server.config[:pid]}.oldbin"
if File.exist?(old_pid) && server.pid != old_pid
begin
Process.kill("QUIT", File.read(old_pid).to_i)
rescue Errno::ENOENT, Errno::ESRCH
# someone else did our job for us
end
end
end

after_fork do |server, worker|
ActiveRecord::Base.establish_connection
end
11 changes: 11 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Documentation

## User documentation

- [Check out Huginn with Docker](./tobewritten.md) Run a local Huginn installation using Docker


## Administrator documentation

- [Install](install/README.md) Requirements, directory structures and installation from source.
- [Update](update/README.md) Update guides to upgrade your installation.
5 changes: 5 additions & 0 deletions doc/install/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Installation

- [Requirements](requirements.md) Software and hardware requirements to run the Huginn installation
- [Install](installation.md) Installation guide for Ubundu/Debian
- [Update](update.md) Update an existing Huginn installation
Loading

0 comments on commit 0e4c9be

Please sign in to comment.