Skip to content

Commit

Permalink
Add a deploy task and update the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpace committed Aug 14, 2010
1 parent 8318f6b commit c54cc32
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Capfile
@@ -0,0 +1,4 @@
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }

load 'config/deploy' # remove this line to skip loading any of the default tasks
34 changes: 28 additions & 6 deletions README.md
Expand Up @@ -4,15 +4,37 @@ Errbit: The open source self-hosted Hoptoad Server
Installation Installation
------------ ------------


1. Install MongoDB *Note*: This app is intended for people with experience deploying and maintining
2. Install & Run Bundler Rails applications. If you're uncomfortable with any step below then Errbit is not
3. Seed DB - rake db:seed for you. Checkout [Hoptoad](http://hoptoadapp.com) from the guys over at
[Thoughbot](http://thoughtbot.com), which Errbit is based on.

Set your local box or server(Ubuntu):
1. Install MongoDB
* Follow the directions [here](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages) then:

aptitude update
aptitude install mongodb

2. Install libxml

apt-get install libxml2 libxml2-dev libxslt-dev

3. Install Bundler

gem install bundler --pre

Deploy:
1. Bootstrap Errbit. This will copy over config.yml and also seed the database.

rake errbit:bootstrap

2. Update the config.yml file with information about your server
3. cap deploy:setup deploy


TODO TODO
---- ----


Add capistrano
Add form.error_messages Add form.error_messages
Add a deployment view Add a deployment view
Add ability for watchers to be configured for types of notifications they should receive Add ability for watchers to be configured for types of notifications they should receive
Differentiate resolved errs
47 changes: 47 additions & 0 deletions config/deploy.rb
@@ -0,0 +1,47 @@
require 'config/environment'

set :application, "errbit"
set :repository, "http://github.com/jdpace/errbit.git"

set :scm, :git
set :scm_verbose, true
set(:current_branch) { `git branch`.match(/\* (\S+)\s/m)[1] || raise("Couldn't determine current branch") }
set :branch, defer { current_branch }

set :user, :deploy
set :use_sudo, false
set :ssh_options, { :forward_agent => true }
default_run_options[:pty] = true

set :deploy_to, "/var/www/apps/#{application}"
set :deploy_via, :remote_cache
set :copy_cache, true
set :copy_exclude, [".git"]
set :copy_compression, :bz2

role :web, Errbit::Config.host
role :app, Errbit::Config.host
role :db, Errbit::Config.host, :primary => true

after 'deploy:update_code', 'bundler:install'

namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end

namespace :bundler do
task :symlink_vendor, :roles => :app, :except => { :no_release => true } do
shared_gems = File.join(shared_path,'vendor','bundler_gems')
release_gems = "#{latest_release}/vendor/"
run("mkdir -p #{shared_gems} && ln -nfs #{shared_gems} #{release_gems}")
end

task :install, :rolse => :app do
bundler.symlink_vendor
run("cd #{release_path} && bundle install vendor/bundler_gems --without development test")
end
end

0 comments on commit c54cc32

Please sign in to comment.