summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-08-15 11:31:40 +0200
committerAzul <azul@riseup.net>2016-08-15 11:41:36 +0200
commit58c63cac98cdacc6ec7230e1133bcb35f0f22582 (patch)
treefd6944b3ecd5ad29c8586dd4c8cc28d7a224761c /config
parent75c037e5d6d8b8f2b98477bdd0359f5687bd7517 (diff)
[ci] move configs into config dir
Diffstat (limited to 'config')
-rw-r--r--config/ci/gitlab/couchdb.yml3
-rw-r--r--config/ci/travis/README17
-rw-r--r--config/ci/travis/couchdb.admin.yml5
-rw-r--r--config/ci/travis/couchdb.yml4
-rw-r--r--config/ci/travis/ruby-version1
-rwxr-xr-xconfig/ci/travis/setup_couch.sh17
6 files changed, 47 insertions, 0 deletions
diff --git a/config/ci/gitlab/couchdb.yml b/config/ci/gitlab/couchdb.yml
new file mode 100644
index 0000000..68761dc
--- /dev/null
+++ b/config/ci/gitlab/couchdb.yml
@@ -0,0 +1,3 @@
+test:
+ auto_update_design_doc: false
+ host: "couchdb"
diff --git a/config/ci/travis/README b/config/ci/travis/README
new file mode 100644
index 0000000..58e37b2
--- /dev/null
+++ b/config/ci/travis/README
@@ -0,0 +1,17 @@
+These files are used for Travis tests to test admin and user permissions:
+
+couchdb.yml.admin:
+
+ when activated, leap_web has admin permissions (e.g. ability to create
+ databases, upload design docs).
+
+couchdb.yml.user:
+
+ when activited, leap_web has normal permissions (e.g. can modify all the
+ records).
+
+The term 'user' here is misleading. It is really two different types of admin
+permissions.
+
+Rails or rake must be run with 'test' environment for these configs to be
+used.
diff --git a/config/ci/travis/couchdb.admin.yml b/config/ci/travis/couchdb.admin.yml
new file mode 100644
index 0000000..a7677f9
--- /dev/null
+++ b/config/ci/travis/couchdb.admin.yml
@@ -0,0 +1,5 @@
+test:
+ auto_update_design_doc: false
+ username: "anna"
+ password: "secret"
+
diff --git a/config/ci/travis/couchdb.yml b/config/ci/travis/couchdb.yml
new file mode 100644
index 0000000..a57b888
--- /dev/null
+++ b/config/ci/travis/couchdb.yml
@@ -0,0 +1,4 @@
+test:
+ auto_update_design_doc: false
+ username: "me"
+ password: "pwd"
diff --git a/config/ci/travis/ruby-version b/config/ci/travis/ruby-version
new file mode 100644
index 0000000..68b3a4c
--- /dev/null
+++ b/config/ci/travis/ruby-version
@@ -0,0 +1 @@
+1.9.3-p551
diff --git a/config/ci/travis/setup_couch.sh b/config/ci/travis/setup_couch.sh
new file mode 100755
index 0000000..0502c12
--- /dev/null
+++ b/config/ci/travis/setup_couch.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+HOST="http://localhost:5984"
+echo "couch version :"
+curl -X GET $HOST
+echo "creating user :"
+curl -HContent-Type:application/json -XPUT $HOST/_users/org.couchdb.user:me --data-binary '{"_id": "org.couchdb.user:me","name": "me","roles": [],"type": "user","password": "pwd"}'
+echo "creating databases :"
+curl -X PUT $HOST/sessions
+curl -X PUT $HOST/users
+curl -X PUT $HOST/tickets
+echo "restricting database access :"
+curl -X PUT $HOST/sessions/_security -Hcontent-type:application/json --data-binary '{"admins":{"names":[],"roles":[]},"members":{"names":["me"],"roles":[]}}'
+curl -X PUT $HOST/users/_security -Hcontent-type:application/json --data-binary '{"admins":{"names":[],"roles":[]},"members":{"names":["me"],"roles":[]}}'
+curl -X PUT $HOST/tickets/_security -Hcontent-type:application/json --data-binary '{"admins":{"names":[],"roles":[]},"members":{"names":["me"],"roles":[]}}'
+echo "adding admin :"
+curl -X PUT $HOST/_config/admins/anna -d '"secret"'