From 58c63cac98cdacc6ec7230e1133bcb35f0f22582 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 15 Aug 2016 11:31:40 +0200 Subject: [ci] move configs into config dir --- .gitlab-ci.yml | 4 ++-- .travis.yml | 8 ++++---- config/ci/gitlab/couchdb.yml | 3 +++ config/ci/travis/README | 17 +++++++++++++++++ config/ci/travis/couchdb.admin.yml | 5 +++++ config/ci/travis/couchdb.yml | 4 ++++ config/ci/travis/ruby-version | 1 + config/ci/travis/setup_couch.sh | 17 +++++++++++++++++ test/config/README | 17 ----------------- test/config/gitlab/couchdb.yml | 3 --- test/config/travis/couchdb.admin.yml | 5 ----- test/config/travis/couchdb.yml | 4 ---- test/config/travis/ruby-version | 1 - test/config/travis/setup_couch.sh | 17 ----------------- 14 files changed, 53 insertions(+), 53 deletions(-) create mode 100644 config/ci/gitlab/couchdb.yml create mode 100644 config/ci/travis/README create mode 100644 config/ci/travis/couchdb.admin.yml create mode 100644 config/ci/travis/couchdb.yml create mode 100644 config/ci/travis/ruby-version create mode 100755 config/ci/travis/setup_couch.sh delete mode 100644 test/config/README delete mode 100644 test/config/gitlab/couchdb.yml delete mode 100644 test/config/travis/couchdb.admin.yml delete mode 100644 test/config/travis/couchdb.yml delete mode 100644 test/config/travis/ruby-version delete mode 100755 test/config/travis/setup_couch.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01c4103..3bf5571 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,8 +20,8 @@ before_script: - ruby -v - curl -s couchdb:5984 - git submodule update --init - - cp test/config/gitlab/couchdb.yml config/couchdb.admin.yml - - cp test/config/gitlab/couchdb.yml config + - cp config/ci/gitlab/couchdb.yml config/couchdb.admin.yml + - cp config/ci/gitlab/couchdb.yml config - gem install bundler --no-ri --no-rdoc - bundle install -j $(nproc) --path vendor --without development debug - bundle exec rake RAILS_ENV=test db:rotate diff --git a/.travis.yml b/.travis.yml index 2681951..ecf2c16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,10 @@ before_install: - "gem install bundler --version 1.11.2" before_script: - "rm .ruby-version" - - "mv test/config/travis/ruby-version .ruby-version" - - "test/config/travis/setup_couch.sh" - - "mv test/config/travis/couchdb.admin.yml config/couchdb.admin.yml" - - "mv test/config/travis/couchdb.yml config/couchdb.yml" + - "mv config/ci/travis/ruby-version .ruby-version" + - "config/ci/travis/setup_couch.sh" + - "mv config/ci/travis/couchdb.admin.yml config/couchdb.admin.yml" + - "mv config/ci/travis/couchdb.yml config/couchdb.yml" - "bundle exec rake RAILS_ENV=test db:rotate" - "bundle exec rake RAILS_ENV=test db:migrate" after_script: 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"' diff --git a/test/config/README b/test/config/README deleted file mode 100644 index 58e37b2..0000000 --- a/test/config/README +++ /dev/null @@ -1,17 +0,0 @@ -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/test/config/gitlab/couchdb.yml b/test/config/gitlab/couchdb.yml deleted file mode 100644 index 68761dc..0000000 --- a/test/config/gitlab/couchdb.yml +++ /dev/null @@ -1,3 +0,0 @@ -test: - auto_update_design_doc: false - host: "couchdb" diff --git a/test/config/travis/couchdb.admin.yml b/test/config/travis/couchdb.admin.yml deleted file mode 100644 index a7677f9..0000000 --- a/test/config/travis/couchdb.admin.yml +++ /dev/null @@ -1,5 +0,0 @@ -test: - auto_update_design_doc: false - username: "anna" - password: "secret" - diff --git a/test/config/travis/couchdb.yml b/test/config/travis/couchdb.yml deleted file mode 100644 index a57b888..0000000 --- a/test/config/travis/couchdb.yml +++ /dev/null @@ -1,4 +0,0 @@ -test: - auto_update_design_doc: false - username: "me" - password: "pwd" diff --git a/test/config/travis/ruby-version b/test/config/travis/ruby-version deleted file mode 100644 index 68b3a4c..0000000 --- a/test/config/travis/ruby-version +++ /dev/null @@ -1 +0,0 @@ -1.9.3-p551 diff --git a/test/config/travis/setup_couch.sh b/test/config/travis/setup_couch.sh deleted file mode 100755 index 0502c12..0000000 --- a/test/config/travis/setup_couch.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/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