This shows you the differences between two versions of the page.
|
development:codebase_guidelines [2010/07/20 23:00] jits |
development:codebase_guidelines [2010/08/02 16:34] (current) jits |
||
|---|---|---|---|
| Line 30: | Line 30: | ||
| * Anything in /vendor/plugins/acts_as_solr/solr/temp | * Anything in /vendor/plugins/acts_as_solr/solr/temp | ||
| - | * Set ENABLE_SEARCH to false temporarily for the db:migrate | + | * Set **ENABLE_SEARCH** to ''false'' temporarily for the **initial** db:migrate used to set up the database in the first place |
| - | ===== Installation and running instructions ===== | + | ===== Installation ===== |
| - | **Note:** for production set ups, always add RAILS_ENV=production to the end of the command, except for: | + | See **[[Development:Installation|installation instructions page]]** |
| - | + | ||
| - | ruby script/server -e production | + | |
| - | + | ||
| - | ruby script/console production | + | |
| - | + | ||
| - | **Set up instructions:** | + | |
| - | + | ||
| - | * Set up a memcached server(s) (optional) | + | |
| - | + | ||
| - | * Install the required ruby gems mentioned in the section "Gems" below | + | |
| - | + | ||
| - | * Checkout the source code from here: http://biocatalogue.rubyforge.org/svn/trunk/ | + | |
| - | + | ||
| - | svn checkout http://biocatalogue.rubyforge.org/svn/trunk/ biocatalogue | + | |
| - | + | ||
| - | * Copy **config/database.yml.pre** to **config/database.yml** and configure accordingly | + | |
| - | * Copy **config/solr.yml.pre** to **config/solr.yml** and configure accordingly | + | |
| - | * Copy **config/memcache.yml.pre** to **config/memcache.yml** and configure accordingly | + | |
| - | * Copy **config/initializers/biocat_local.rb.pre** to **config/initializers/biocat_local.rb** and configure accordingly | + | |
| - | * Copy **config/initializers/mail.rb.pre** to **config/initializers/mail.rb** and configure accordingly | + | |
| - | + | ||
| - | * In the root folder of the application, create the additional following directory structure: | + | |
| - | * log | + | |
| - | * tmp | + | |
| - | * cache | + | |
| - | * pids | + | |
| - | * sessions | + | |
| - | * sockets | + | |
| - | + | ||
| - | * Set up DB. **First, temporarily set ENABLE_SEARCH to ''false'' in config/initializers/biocat_local.rb.** Then: | + | |
| - | + | ||
| - | rake db:migrate | + | |
| - | + | ||
| - | OR if that doesn't work, see the section [[development:codebase_guidelines#production_database|Production Database]] below. | + | |
| - | + | ||
| - | * Start the search engine (Solr) (for more info, see the section "Search Server (Solr)" below): | + | |
| - | + | ||
| - | rake solr:start | + | |
| - | + | ||
| - | * Run the asset packager (for production mode only): | + | |
| - | + | ||
| - | rake asset:packager:build_all | + | |
| - | + | ||
| - | * Set up the [[http://biocatalogue.rubyforge.org/svn/trunk/vendor/wsdl-parsing-service/|WSDL Parser Service]] by following the instructions in the README.txt. You will then need to modify the relevant setting in config/initializers/biocat_local.rb | + | |
| Line 89: | Line 45: | ||
| ==== Need to be installed on server / development environment ==== | ==== Need to be installed on server / development environment ==== | ||
| - | |||
| - | Note: some of these gems may come from GitHub so add "http://gems.github.com/" to your gem sources. | ||
| * rake | * rake | ||
| Line 277: | Line 231: | ||
| See: [[Development: Caching]] | See: [[Development: Caching]] | ||
| - | |||
| - | ===== Production Database ===== | ||
| - | |||
| - | Before: **temporarily set ENABLE_SEARCH to ''false'' in config/initializers/biocat_local.rb.** | ||
| - | |||
| - | In order to create the production database you can do: | ||
| - | |||
| - | rake db:schema:load RAILS_ENV=production | ||
| - | |||
| - | This will load the schema up from /db/schema.rb (which should be kept up to date with the command "rake db:schema:dump"). | ||
| - | |||
| - | Then import the data (or use it empty). | ||
| - | |||
| - | NOTE: this does mean that the initial Registry entries for Feta and SeekDa will not be in there. We need a proper mechanism for importing initial data. | ||
| - | |||
| - | ===== Search Server (Solr) ===== | ||
| - | |||
| - | The solr service comes with the acts_as_solr plugin in our codebase so nothing has to be installed in order to have search enabled. | ||
| - | |||
| - | * To start the search server open a command line in the root of the application and type: | ||
| - | |||
| - | rake solr:start | ||
| - | |||
| - | * To stop the search server: | ||
| - | |||
| - | rake solr:stop | ||
| - | |||
| - | * To reindex everything in the production database: | ||
| - | |||
| - | rake solr:reindex RAILS_ENV=production --trace | ||
| - | |||
| - | (make sure that the production solr instance has been started) | ||
| - | |||
| - | * To reindex everything in the development database: | ||
| - | |||
| - | rake solr:reindex --trace | ||
| - | |||
| - | * To optimise the production mode index: | ||
| - | |||
| - | ruby script/runner -e production "Service.solr_optimize" | ||
| - | |||
| - | * To optimise the development mode index: | ||
| - | |||
| - | ruby script/runner "Service.solr_optimize" | ||
| - | |||
| - | \\ | ||