diff options
author | Azul <azul@leap.se> | 2014-01-03 20:01:59 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2014-01-03 20:01:59 +0100 |
commit | b9de6cfeac4ef061f3110afa0be959e41cb6f885 (patch) | |
tree | aaae9b76f09e6b10f953d0439ed518b4597631a8 | |
parent | 62f31ab0358bc165c9a83806db1828365cb96572 (diff) |
document new way we deploy couch design docs
-rw-r--r-- | DEPLOY.md | 25 | ||||
-rw-r--r-- | DEVELOP.md | 2 |
2 files changed, 24 insertions, 3 deletions
@@ -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. @@ -95,4 +95,4 @@ For example: test "robot" do login_as @user visit robot_path(@robot, :locale => nil) - end
\ No newline at end of file + end |