Merge pull request #450 from gopesht/dj_deploy

Adds delayed jobs recipe for production, and some documentation
This commit is contained in:
Artem Chernikov 2014-08-19 09:50:36 +02:00
commit 65291d8b0d
2 changed files with 12 additions and 1 deletions

View file

@ -60,6 +60,12 @@ myprovider_secret = 'sample data'
That is required so that the check in app/views/devise/shared/_openid.html.haml will pass and That is required so that the check in app/views/devise/shared/_openid.html.haml will pass and
the image-link to login using the provider will be shown. the image-link to login using the provider will be shown.
11. Open a separate terminal and go into the directory where the rails app is present, and type the following to start the delayed_jobs worker for sending email notifications.
```
rake jobs:work
```
### Run OSEM in production ### Run OSEM in production
We recommend to run OSEM in production with [mod_passenger](https://www.phusionpassenger.com/download/#open_source) We recommend to run OSEM in production with [mod_passenger](https://www.phusionpassenger.com/download/#open_source)
and the [apache web-server](https://www.apache.org/). There are tons of guides on how to deploy rails apps on various and the [apache web-server](https://www.apache.org/). There are tons of guides on how to deploy rails apps on various

View file

@ -28,6 +28,10 @@ end
desc 'Deploys the current version to the server.' desc 'Deploys the current version to the server.'
task deploy: :environment do task deploy: :environment do
to :prepare do
queue "cd #{deploy_to}/current && RAILS_ENV=production script/delayed_job stop"
end
deploy do deploy do
invoke :'git:clone' invoke :'git:clone'
invoke :'deploy:link_shared_paths' invoke :'deploy:link_shared_paths'
@ -38,6 +42,7 @@ task deploy: :environment do
to :launch do to :launch do
queue "sudo /etc/init.d/apache2 restart" queue "sudo /etc/init.d/apache2 restart"
queue "cd #{deploy_to}/current && RAILS_ENV=production script/delayed_job start"
end end
invoke :'deploy:cleanup' invoke :'deploy:cleanup'