From bef746ae7b215db78be088657bbfaf47c774f943 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 8 Aug 2016 10:25:54 +0200 Subject: [ci] setup couch for gitlab Couch docker image will be available on the host called couchdb. So we use curl to check for it and display the version string. And then we move a couchdb.yml config file into place so the right host will be used. --- test/config/couchdb.admin.yml | 6 ------ test/config/couchdb.yml | 5 ----- test/config/gitlab/couchdb.yml | 4 ++++ test/config/travis/couchdb.admin.yml | 6 ++++++ test/config/travis/couchdb.yml | 5 +++++ test/config/travis/ruby-version | 1 + test/config/travis/setup_couch.sh | 17 +++++++++++++++++ 7 files changed, 33 insertions(+), 11 deletions(-) delete mode 100644 test/config/couchdb.admin.yml delete mode 100644 test/config/couchdb.yml create mode 100644 test/config/gitlab/couchdb.yml create mode 100644 test/config/travis/couchdb.admin.yml create mode 100644 test/config/travis/couchdb.yml create mode 100644 test/config/travis/ruby-version create mode 100755 test/config/travis/setup_couch.sh (limited to 'test/config') diff --git a/test/config/couchdb.admin.yml b/test/config/couchdb.admin.yml deleted file mode 100644 index 0988bc1..0000000 --- a/test/config/couchdb.admin.yml +++ /dev/null @@ -1,6 +0,0 @@ -test: - auto_update_design_doc: false - username: "anna" - password: "secret" - prefix: "" - diff --git a/test/config/couchdb.yml b/test/config/couchdb.yml deleted file mode 100644 index 9c8b67b..0000000 --- a/test/config/couchdb.yml +++ /dev/null @@ -1,5 +0,0 @@ -test: - auto_update_design_doc: false - username: "me" - password: "pwd" - prefix: "" diff --git a/test/config/gitlab/couchdb.yml b/test/config/gitlab/couchdb.yml new file mode 100644 index 0000000..5d4f71f --- /dev/null +++ b/test/config/gitlab/couchdb.yml @@ -0,0 +1,4 @@ +test: + auto_update_design_doc: false + host: "couchdb" + prefix: "" diff --git a/test/config/travis/couchdb.admin.yml b/test/config/travis/couchdb.admin.yml new file mode 100644 index 0000000..7c9584c --- /dev/null +++ b/test/config/travis/couchdb.admin.yml @@ -0,0 +1,6 @@ +test: + auto_update_design_doc: false + username: "anna" + password: "secret" + prefix: "" + diff --git a/test/config/travis/couchdb.yml b/test/config/travis/couchdb.yml new file mode 100644 index 0000000..9c8b67b --- /dev/null +++ b/test/config/travis/couchdb.yml @@ -0,0 +1,5 @@ +test: + auto_update_design_doc: false + username: "me" + password: "pwd" + prefix: "" diff --git a/test/config/travis/ruby-version b/test/config/travis/ruby-version new file mode 100644 index 0000000..68b3a4c --- /dev/null +++ b/test/config/travis/ruby-version @@ -0,0 +1 @@ +1.9.3-p551 diff --git a/test/config/travis/setup_couch.sh b/test/config/travis/setup_couch.sh new file mode 100755 index 0000000..0502c12 --- /dev/null +++ b/test/config/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"' -- cgit v1.2.3 From 75c037e5d6d8b8f2b98477bdd0359f5687bd7517 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 12 Aug 2016 23:10:50 +0200 Subject: [ci] use default db prefix on gitlab and travis This makes writing the tests for database names easier as they should be the same strings on gitlab, travis and locally. --- test/config/gitlab/couchdb.yml | 1 - test/config/travis/couchdb.admin.yml | 1 - test/config/travis/couchdb.yml | 1 - 3 files changed, 3 deletions(-) (limited to 'test/config') diff --git a/test/config/gitlab/couchdb.yml b/test/config/gitlab/couchdb.yml index 5d4f71f..68761dc 100644 --- a/test/config/gitlab/couchdb.yml +++ b/test/config/gitlab/couchdb.yml @@ -1,4 +1,3 @@ test: auto_update_design_doc: false host: "couchdb" - prefix: "" diff --git a/test/config/travis/couchdb.admin.yml b/test/config/travis/couchdb.admin.yml index 7c9584c..a7677f9 100644 --- a/test/config/travis/couchdb.admin.yml +++ b/test/config/travis/couchdb.admin.yml @@ -2,5 +2,4 @@ test: auto_update_design_doc: false username: "anna" password: "secret" - prefix: "" diff --git a/test/config/travis/couchdb.yml b/test/config/travis/couchdb.yml index 9c8b67b..a57b888 100644 --- a/test/config/travis/couchdb.yml +++ b/test/config/travis/couchdb.yml @@ -2,4 +2,3 @@ test: auto_update_design_doc: false username: "me" password: "pwd" - prefix: "" -- cgit v1.2.3