From 011a61afd4b7e506c760ba6f62891b8038506758 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Tue, 14 Jun 2016 16:59:26 +0200 Subject: [PATCH] Deployment section added --- README.rdoc | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index 5da0471..3c30bd4 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,6 +1,76 @@ == Installing debshots -TODO +=== Prepare PostgreSQL database server and user + +apt install postgresql + +su - postgres + +createuser -d debshots + +createdb -O debshots debshots + +=== Create an application user + +adduser debshots + +su - debshots + +=== Install the required Ruby version using rbenv + +https://github.com/rbenv/rbenv + +git clone https://github.com/rbenv/rbenv.git ~/.rbenv + +echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile + + +# Load rbenv automatically by appending +# the following to ~/.bashrc: + +eval "$(rbenv init -)" + + +https://github.com/rbenv/ruby-build#readme + +git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build + +=== Get the application + +Clone the debshots Git repository. + +=== Install the Ruby dependencies + +rbenv install + +echo "gem: --no-rdoc --no-ri" > ~/.gemrc + +gem install bundler + +bundle install --deployment + +=== Copy screenshots and database from the former live website + +scp screenshots.debian.net:debshots-screenshots.tar . + +mv live/screenshots/approved public/screenshots + +rm -r live + +scp screenshots.debian.net:debshots.sql . + +psql debshots < debshots.sql + +Migrate database: + +bundle exec rake db:migrate RAILS_ENV=production + +(config/database.yml: production: user/password/host must be commented out) + +Convert screenshots to new format (paperclip): + +bundle exec rake debshots:screenshots_to_paperclip RAILS_ENV=production + == Supported URL paths (aka routes)