summaryrefslogtreecommitdiff
path: root/puppet/modules/site_couchdb/manifests/upload_design.pp
blob: bd73ebf2a249a5b21b2a6b2f906d1d4419b44f53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# upload a design doc to a db
define site_couchdb::upload_design($design, $db = $title) {
  $design_name = regsubst($design, '^.*\/(.*)\.json$', '\1')
  $id = "_design/${design_name}"
  $file = "/srv/leap/couchdb/designs/${design}"
  exec {
    "upload_design_${name}":
      command => "/usr/local/bin/couch-doc-update --host 127.0.0.1:5984 --db '${db}' --id '${id}' --data '{}' --file '${file}'",
      refreshonly => false,
      loglevel => debug,
      logoutput => on_failure,
      require => File['/srv/leap/couchdb/designs'];
  }
}