Skip to content

Commit c54cc32

Browse files
committed
Add a deploy task and update the readme
1 parent 8318f6b commit c54cc32

File tree

3 files changed

+79
-6
lines changed

3 files changed

+79
-6
lines changed

Capfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
2+
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
3+
4+
load 'config/deploy' # remove this line to skip loading any of the default tasks

README.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,37 @@ Errbit: The open source self-hosted Hoptoad Server
44
Installation
55
------------
66

7-
1. Install MongoDB
8-
2. Install & Run Bundler
9-
3. Seed DB - rake db:seed
7+
*Note*: This app is intended for people with experience deploying and maintining
8+
Rails applications. If you're uncomfortable with any step below then Errbit is not
9+
for you. Checkout [Hoptoad](http://hoptoadapp.com) from the guys over at
10+
[Thoughbot](http://thoughtbot.com), which Errbit is based on.
11+
12+
Set your local box or server(Ubuntu):
13+
1. Install MongoDB
14+
* Follow the directions [here](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages) then:
15+
16+
aptitude update
17+
aptitude install mongodb
18+
19+
2. Install libxml
20+
21+
apt-get install libxml2 libxml2-dev libxslt-dev
22+
23+
3. Install Bundler
24+
25+
gem install bundler --pre
26+
27+
Deploy:
28+
1. Bootstrap Errbit. This will copy over config.yml and also seed the database.
29+
30+
rake errbit:bootstrap
31+
32+
2. Update the config.yml file with information about your server
33+
3. cap deploy:setup deploy
1034

1135
TODO
1236
----
1337

14-
Add capistrano
1538
Add form.error_messages
1639
Add a deployment view
17-
Add ability for watchers to be configured for types of notifications they should receive
18-
Differentiate resolved errs
40+
Add ability for watchers to be configured for types of notifications they should receive

config/deploy.rb

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
require 'config/environment'
2+
3+
set :application, "errbit"
4+
set :repository, "http://github.com/jdpace/errbit.git"
5+
6+
set :scm, :git
7+
set :scm_verbose, true
8+
set(:current_branch) { `git branch`.match(/\* (\S+)\s/m)[1] || raise("Couldn't determine current branch") }
9+
set :branch, defer { current_branch }
10+
11+
set :user, :deploy
12+
set :use_sudo, false
13+
set :ssh_options, { :forward_agent => true }
14+
default_run_options[:pty] = true
15+
16+
set :deploy_to, "/var/www/apps/#{application}"
17+
set :deploy_via, :remote_cache
18+
set :copy_cache, true
19+
set :copy_exclude, [".git"]
20+
set :copy_compression, :bz2
21+
22+
role :web, Errbit::Config.host
23+
role :app, Errbit::Config.host
24+
role :db, Errbit::Config.host, :primary => true
25+
26+
after 'deploy:update_code', 'bundler:install'
27+
28+
namespace :deploy do
29+
task :start do ; end
30+
task :stop do ; end
31+
task :restart, :roles => :app, :except => { :no_release => true } do
32+
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
33+
end
34+
end
35+
36+
namespace :bundler do
37+
task :symlink_vendor, :roles => :app, :except => { :no_release => true } do
38+
shared_gems = File.join(shared_path,'vendor','bundler_gems')
39+
release_gems = "#{latest_release}/vendor/"
40+
run("mkdir -p #{shared_gems} && ln -nfs #{shared_gems} #{release_gems}")
41+
end
42+
43+
task :install, :rolse => :app do
44+
bundler.symlink_vendor
45+
run("cd #{release_path} && bundle install vendor/bundler_gems --without development test")
46+
end
47+
end

0 commit comments

Comments
 (0)