diff --git a/Capfile b/Capfile new file mode 100644 index 000000000..e04728e8d --- /dev/null +++ b/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 \ No newline at end of file diff --git a/README.md b/README.md index f48ad691d..4440b536c 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file +Add ability for watchers to be configured for types of notifications they should receive \ No newline at end of file diff --git a/config/deploy.rb b/config/deploy.rb new file mode 100644 index 000000000..edf8ec83f --- /dev/null +++ b/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 \ No newline at end of file