Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add a deploy task and update the readme

  • Loading branch information...
commit c54cc32a4c7201cacda51e68a51b2a7f08e64da8 1 parent 8318f6b
Jared Pace authored August 14, 2010
4  Capfile
... ...
@@ -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
34  README.md
Source Rendered
@@ -4,15 +4,37 @@ Errbit: The open source self-hosted Hoptoad Server
4 4
 Installation
5 5
 ------------
6 6
 
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
10 34
 
11 35
 TODO
12 36
 ----
13 37
 
14  
-Add capistrano
15 38
 Add form.error_messages
16 39
 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
47  config/deploy.rb
... ...
@@ -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 notes on commit c54cc32

Please sign in to comment.
Something went wrong with that request. Please try again.