Deployment section added

This commit is contained in:
Christoph Haas 2016-06-14 16:59:26 +02:00
parent e5ceab72a9
commit 011a61afd4

View file

@ -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)