From dced8579f8e21128e4164b5e27f154afd60edb39 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 5 Mar 2013 14:03:29 +0100 Subject: no auto update - migrate the couch before --- .travis.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 6b9a119..5821fda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,3 +2,4 @@ services: - couchdb notifications: email: false +before_script: "bundle exec rake couchrest:migrate_with_proxies" -- cgit v1.2.3 From eb6cd0962108412fe92ac8ee2d013d22c0e709d4 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 5 Mar 2013 14:21:46 +0100 Subject: restrict couch access to admin --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 5821fda..44da3cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,7 @@ services: - couchdb notifications: email: false -before_script: "bundle exec rake couchrest:migrate_with_proxies" +before_script: + - "bundle exec rake couchrest:migrate_with_proxies" + - 'HOST="http://localhost:5984"' + - "curl -X PUT $HOST/_config/admins/anna -d '\"secret\"'" -- cgit v1.2.3 From 3caa4dd1bdf2ddc3c32baf4e3add8cd06c37f9f5 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 5 Mar 2013 14:51:44 +0100 Subject: make sure couchrest actually finds our models in the engines --- .travis.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 44da3cb..1d0939d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,5 +4,6 @@ notifications: email: false before_script: - "bundle exec rake couchrest:migrate_with_proxies" + - "bundle exec rake couchrest:migrate_with_proxies" # looks like this needs to run twice - 'HOST="http://localhost:5984"' - "curl -X PUT $HOST/_config/admins/anna -d '\"secret\"'" -- cgit v1.2.3 From a285e20602bbffbf1436be2036ecf103bb898dfb Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 5 Mar 2013 14:52:49 +0100 Subject: create sessions db - it's not a CouchRest Model db. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 1d0939d..63b69b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,4 +6,5 @@ before_script: - "bundle exec rake couchrest:migrate_with_proxies" - "bundle exec rake couchrest:migrate_with_proxies" # looks like this needs to run twice - 'HOST="http://localhost:5984"' + - "curl -X PUT $HOST/sessions" - "curl -X PUT $HOST/_config/admins/anna -d '\"secret\"'" -- cgit v1.2.3 From c3bf76fcacb9576f674895a57fd3a47a2872fd8e Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 5 Mar 2013 15:56:02 +0100 Subject: setup user and restrict db access --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 63b69b1..445be1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,14 @@ services: notifications: email: false before_script: + - "mv config/couchdb.yml.admin config/couchdb.yml" - "bundle exec rake couchrest:migrate_with_proxies" - "bundle exec rake couchrest:migrate_with_proxies" # looks like this needs to run twice - 'HOST="http://localhost:5984"' + - "curl -HContent-Type:application/json -vXPUT $HOST/_users/org.couchdb.user:me --data-binary '{\"_id\": \"org.couchdb.user:me\",\"name\": \"me\",\"roles\": [],\"type\": \"user\",\"password\": \"pwd\"}'" - "curl -X PUT $HOST/sessions" + - "curl -vX PUT $HOST/sessions/_security -Hcontent-type:application/json --data-binary '{\"admins\":{\"names\":[],\"roles\":[]},\"members\":{\"names\":[\"me\"],\"roles\":[]}}'" + - "curl -vX PUT $HOST/users/_security -Hcontent-type:application/json --data-binary '{\"admins\":{\"names\":[],\"roles\":[]},\"members\":{\"names\":[\"me\"],\"roles\":[]}}'" + - "curl -vX PUT $HOST/tickets/_security -Hcontent-type:application/json --data-binary '{\"admins\":{\"names\":[],\"roles\":[]},\"members\":{\"names\":[\"me\"],\"roles\":[]}}'" - "curl -X PUT $HOST/_config/admins/anna -d '\"secret\"'" + - "mv config/couchdb.yml.user config/couchdb.yml" -- cgit v1.2.3 From f70366e27aaac985c876d1d0260d7aab8b7ed8b5 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 6 Mar 2013 11:43:49 +0100 Subject: simulate couch migration workflow on travis * first setup couch similar to what we'll have on the platform * then run migrations as admin * then drop admin privileges * then proceed with the normal test script --- .travis.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 445be1a..232467c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,15 +2,9 @@ services: - couchdb notifications: email: false -before_script: - - "mv config/couchdb.yml.admin config/couchdb.yml" +before_script: + - "test/setup_couch.sh" + - "mv test/config/couchdb.yml.admin config/couchdb.yml" - "bundle exec rake couchrest:migrate_with_proxies" - "bundle exec rake couchrest:migrate_with_proxies" # looks like this needs to run twice - - 'HOST="http://localhost:5984"' - - "curl -HContent-Type:application/json -vXPUT $HOST/_users/org.couchdb.user:me --data-binary '{\"_id\": \"org.couchdb.user:me\",\"name\": \"me\",\"roles\": [],\"type\": \"user\",\"password\": \"pwd\"}'" - - "curl -X PUT $HOST/sessions" - - "curl -vX PUT $HOST/sessions/_security -Hcontent-type:application/json --data-binary '{\"admins\":{\"names\":[],\"roles\":[]},\"members\":{\"names\":[\"me\"],\"roles\":[]}}'" - - "curl -vX PUT $HOST/users/_security -Hcontent-type:application/json --data-binary '{\"admins\":{\"names\":[],\"roles\":[]},\"members\":{\"names\":[\"me\"],\"roles\":[]}}'" - - "curl -vX PUT $HOST/tickets/_security -Hcontent-type:application/json --data-binary '{\"admins\":{\"names\":[],\"roles\":[]},\"members\":{\"names\":[\"me\"],\"roles\":[]}}'" - - "curl -X PUT $HOST/_config/admins/anna -d '\"secret\"'" - - "mv config/couchdb.yml.user config/couchdb.yml" + - "mv test/config/couchdb.yml.user config/couchdb.yml" -- cgit v1.2.3