Permalink
Browse files

Add a deploy task and update the readme

  • Loading branch information...
1 parent 8318f6b commit c54cc32a4c7201cacda51e68a51b2a7f08e64da8 @jdpace jdpace committed Aug 14, 2010
Showing with 79 additions and 6 deletions.
  1. +4 −0 Capfile
  2. +28 −6 README.md
  3. +47 −0 config/deploy.rb
View
@@ -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
View
@@ -4,15 +4,37 @@ Errbit: The open source self-hosted Hoptoad Server
Installation
------------
-1. Install MongoDB
-2. Install & Run Bundler
-3. Seed DB - rake db:seed
+*Note*: This app is intended for people with experience deploying and maintining
+Rails applications. If you're uncomfortable with any step below then Errbit is not
+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
----
-Add capistrano
Add form.error_messages
Add a deployment view
-Add ability for watchers to be configured for types of notifications they should receive
-Differentiate resolved errs
+Add ability for watchers to be configured for types of notifications they should receive
View
@@ -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.