So I want to replicate some changes I made to my design files from dev to production (a.k.a. I want to deploy something).
I'm somehow confused since my research did not lead to any concrete results. Although this seams IMHO like a pretty obvious use case.
Am I missing something?
You can specify the document IDs to replicate, without having to write a filter. Post the replication document (or command) like so:
{ "source": "my_db"
, "target": "http://target:5984/target_db"
, "doc_ids": [ "_design/my_ddoc" ]
}
You can use 'Filtered Replication' (See http://wiki.apache.org/couchdb/Replication#Filtered_Replication for details)
Basically, you'll supply a function that returns true for design documents like;
function(doc, req) {
return "_design/" === doc._id.substr(0, 8)
}
and then add "filter":"ddocname/filtername" to your _replicate request body.
I keep my design documents stored as .js files on disk. Then I use couchdb-update-views to update the design documents on a server
npm install -g couchdb-update-views
couchdb-update-views --config /path/to/config.json --docsDir /path/to/design/docs/directory/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With