2013-05-25 20:03:53 +02:00
|
|
|
Deployment
|
|
|
|
=========
|
|
|
|
|
|
|
|
Setup
|
2014-01-17 09:49:16 +01:00
|
|
|
-----
|
2013-05-25 20:03:53 +02:00
|
|
|
|
2014-01-17 09:49:16 +01:00
|
|
|
1. Initialise your [Capistrano](http://capistranorb.com/) setup
|
|
|
|
|
2014-06-18 13:26:22 +02:00
|
|
|
bundle exec cap install
|
|
|
|
sed -i 's|^# \(require.*rails.*\)|\1|' Capfile
|
|
|
|
cp config/deploy.rb.SAMPLE config/deploy.rb
|
2014-01-17 09:49:16 +01:00
|
|
|
|
|
|
|
When you're using [RVM](http://rvm.io/) on the server you may want to
|
|
|
|
uncomment the corresponding line in `Capfile`.
|
|
|
|
|
|
|
|
2. Adapt your configuration in `config/deploy.rb` and `config/deploy/*.rb`
|
2013-05-25 20:03:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
Deploy
|
2014-01-17 09:49:16 +01:00
|
|
|
------
|
2013-05-25 20:03:53 +02:00
|
|
|
|
2014-01-17 09:49:16 +01:00
|
|
|
On your first deploy you should run (choose either staging or production)
|
2013-12-03 19:46:53 +01:00
|
|
|
|
2014-01-17 09:49:16 +01:00
|
|
|
bundle exec cap staging deploy:check
|
|
|
|
|
|
|
|
This will fail, which is ok, because there is no configuration yet. On your
|
|
|
|
server, there is a directory `shared/config` for each installation, which
|
|
|
|
contains the configuration. Create `database.yml`, `app_config.yml` and
|
|
|
|
`initializers/secret_token.rb` and try again.
|
|
|
|
(See `lib/capistrano/tasks/deploy_initial.cap` for a way to automate this.)
|
2013-05-25 20:03:53 +02:00
|
|
|
|
|
|
|
Deploy to staging
|
2013-12-03 19:46:53 +01:00
|
|
|
|
2014-01-17 09:49:16 +01:00
|
|
|
bundle exec cap staging deploy
|
2013-05-25 20:03:53 +02:00
|
|
|
|
|
|
|
Deploy to production
|
2013-12-03 19:46:53 +01:00
|
|
|
|
|
|
|
bundle exec cap production deploy
|
2014-01-17 09:49:16 +01:00
|
|
|
|