Skip to content

Commit

Permalink
ruby v2.7, bundler optimization - v2.3
Browse files Browse the repository at this point in the history
alexskr committed Mar 31, 2022
1 parent 25ee301 commit 76b55c3
Showing 7 changed files with 19 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Git
.bundle
.git
.gitignore
.github
.DS_Store
vendor/bundle
# Logs
log/*
# Temp files
4 changes: 2 additions & 2 deletions .github/workflows/ruby-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: copy config file
run: cp config/config.rb.test config/config.rb
run: cp config/config.test.rb config/config.rb
- name: Build docker-compose
run: docker-compose build
- name: Run unit tests
run: docker-compose up --exit-code-from unit-test
run: docker-compose run dev bundle exec rake test TESTOPTS='-v'
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends openjdk-
RUN mkdir -p /srv/ontoportal/ncbo_annotator
COPY Gemfile* /srv/ontoportal/ncbo_annotator/
WORKDIR /srv/ontoportal/ncbo_annotator
RUN gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"
RUN gem install bundler
ENV BUNDLE_PATH /bundle
RUN bundle install
COPY . /srv/ontoportal/ncbo_annotator
CMD ["/bin/bash"]
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -191,4 +191,4 @@ DEPENDENCIES
sparql-client!

BUNDLED WITH
2.1.4
2.3.10
File renamed without changes.
8 changes: 7 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
version: '3.8'

services:
unit-test:
dev:
build: .
volumes:
- bundle:/bundle
- .:/srv/ontoportal/ncbo_annotator
environment:
- BUNDLE_PATH=/bundle
- GOO_BACKEND_NAME=4store
- GOO_PORT=9000
- GOO_HOST=4store-ut
@@ -35,3 +39,5 @@ services:
&& 4s-backend ontoportal_kb
&& 4s-httpd -D -s-1 -p 9000 ontoportal_kb"
volumes:
bundle:
4 changes: 2 additions & 2 deletions run-unit-tests.sh
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
# sample script for running unit tests in docker. This functionality should be moved to a rake task
#
# add config for unit testing
[ -f config/config.rb ] || cp config/config.rb.test config/config.rb
[ -f config/config.rb ] || cp config/config.test.rb config/config.rb
docker-compose build
#docker-compose up --exit-code-from unit-test

docker-compose run --rm unit-test bundle exec rake test TESTOPTS='-v'
docker-compose run --rm dev bundle exec rake test TESTOPTS='-v'
docker-compose kill

0 comments on commit 76b55c3

Please sign in to comment.