From 4d66ebde1560d2509738cc84e048f0b6ae6dd0c1 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Tue, 14 Aug 2018 16:37:06 +0200 Subject: [PATCH] Next try with CI --- .gitlab-ci.yml | 21 ++++++++++++++++----- config/database.yml.gitlab | 8 ++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 config/database.yml.gitlab diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 10b3a07..5851056 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,24 @@ --- test: stage: test + vars: + POSTGRES_DB: test_db + POSTGRES_USER: runner + POSTGRES_PASSWORD: "" tags: - stretch - script: + + services: + - postgres:latest + + before_script: - apt-get update -qy - - apt-get install -y ruby ruby-dev imagemagick git build-essential zlib1g-dev libbz2-dev libpq-dev - - gem install bundler - - bundle install --path /cache - - bundle exec rake db:create RAILS_ENV=test + - apt-get install -y ruby ruby-dev imagemagick git build-essential zlib1g-dev libbz2-dev libpq-dev postgresql + - gem install bundler --no-ri --no-rdoc + - RAILS_ENV=test bundle install --path /cache + - cp config/database.yml.gitlab config/database.yml + - RAILS_ENV=test bundle exec rake db:create db:schema:load + + railstest: - bundle exec rake test diff --git a/config/database.yml.gitlab b/config/database.yml.gitlab new file mode 100644 index 0000000..c8eab40 --- /dev/null +++ b/config/database.yml.gitlab @@ -0,0 +1,8 @@ +test: + adapter: postgresql + database: debshots_test + username: debshots + password: '' + host: localhost + pool: 5 + timeout: 5000