From b9de6cfeac4ef061f3110afa0be959e41cb6f885 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 3 Jan 2014 20:01:59 +0100 Subject: document new way we deploy couch design docs --- DEPLOY.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'DEPLOY.md') diff --git a/DEPLOY.md b/DEPLOY.md index f61301c..23a54a4 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -31,12 +31,33 @@ Please make sure your deploy includes the following files: ## Couch Security ## We recommend against using an admin user for running the webapp. To avoid this couch design documents need to be created ahead of time and the auto update mechanism needs to be disabled. -Take a look at test/setup_couch.sh for an example of securing the couch. After securing the couch migrations need to be run with admin permissions. The before_script block in .travis.yml illustrates how to do this: +Take a look at test/setup_couch.sh for an example of securing the couch. -``` +### DESIGN DOCUMENTS ### + +After securing the couch design documents need to be deployed with admin permissions. There are two ways of doing this: + * rake couchrest:migrate_with_proxies + * dump the documents as files with `rake couchrest:dump` and deploy them + to the couch by hand or with puppet. + +#### CouchRest::Migrate #### + +The before_script block in .travis.yml illustrates how to do this: + +```bash mv test/config/couchdb.yml.admin config/couchdb.yml # use admin privileges bundle exec rake couchrest:migrate_with_proxies # run the migrations bundle exec rake couchrest:migrate_with_proxies # looks like this needs to run twice mv test/config/couchdb.yml.user config/couchdb.yml # drop admin privileges ``` +#### Deploy design docs from CouchRest::Dump #### + +First of all we get the design docs as files: + +```bash +# put design docs in /tmp/design +bundle exec rake couchrest:dump +``` + +Then we add them to files/design in the site_couchdb module in leap_platform so they get deployed with the couch. You could also upload them using curl or sth. similar. -- cgit v1.2.3