-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from mlibrary/SEARCH-1599-update-dependencies
Search 1599 update dependencies
- Loading branch information
Showing
57 changed files
with
626 additions
and
647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MARIADB_ROOT_PASSWORD=pass | ||
CIRCULATION_HISTORY_DATABASE_PASSWORD=circulation_history_db_password | ||
DATABASE_HOST=database | ||
CIRC_REPORT_PATH=/circ/report/path | ||
PATRON_REPORT_PATH=/patron/report/path | ||
ALMA_API_HOST=http://falma:4567 | ||
RAILS_LOG_TO_STDOUT=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,52 +7,43 @@ jobs: | |
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache ruby gems | ||
uses: actions/cache@v2 | ||
services: | ||
mariadb: | ||
image: mariadb:10 | ||
env: | ||
cache-name: ruby-gems | ||
with: | ||
path: .gems | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- uses: satackey/[email protected] | ||
# Ignore the failure of a step and avoid terminating the job. | ||
continue-on-error: true | ||
MARIADB_USER: circulation_history | ||
MARIADB_PASSWORD: circulation_history_db_password | ||
MARIADB_DATABASE: circulation_history_test | ||
MARIADB_ROOT_PASSWORD: pass | ||
ports: ["3306:3306"] | ||
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 | ||
|
||
- name: make coverage directory | ||
run: mkdir -m777 coverage | ||
- name: make tmp directory writeable | ||
run: chmod -R 777 tmp | ||
- name: make fixtures writeable | ||
run: chmod -R 777 spec/fixtures | ||
- name: make app/log/development.log writeable | ||
run: | | ||
mkdir -m777 log | ||
touch log/development.log | ||
chmod 777 log/development.log | ||
- name: list files with permissions | ||
run: | | ||
ls -al | ||
ls -al log | ||
- name: Set up .env | ||
run: cp .env-example .env | ||
- name: Set up tests | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Create .env file | ||
run: | | ||
docker-compose build | ||
docker-compose run web bundle install | ||
- name: boot up database | ||
run: docker-compose up -d database | ||
- name: docker state | ||
run: docker-compose ps | ||
- name: wait for db | ||
run: docker-compose run web bin/wait-for database:3306 | ||
- name: create databases | ||
run: docker-compose run web bundle exec rails db:create | ||
sed 's/DATABASE_HOST=database/DATABASE_HOST=127.0.0.1/' .env-dev-values > .env-actions | ||
cat .env-example .env-actions > .env | ||
- name: Load .env file | ||
uses: xom9ikk/[email protected] | ||
- name: Set up Ruby 3.1.1 | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.1.1 | ||
bundler-cache: true | ||
- name: Setup up node 16.14.2 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16.14.2' | ||
- name: Verify MariaDB connection | ||
run: | | ||
while ! mysqladmin ping -h"127.0.0.1" -P"3306" --silent; do | ||
sleep 1 | ||
done | ||
- name: Set up DB | ||
run: bundle exec rails db:schema:load RAILS_ENV=test | ||
- name: Run linter for Ruby | ||
run: bundle exec standardrb | ||
- name: Run tests | ||
run: docker-compose run web bundle exec rspec | ||
run: bundle exec rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
# Ignore bundler config. | ||
/.bundle | ||
/.cache/ | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
FROM ruby:2.7.2 | ||
ARG RUBY_VERSION=3.1 | ||
FROM ruby:${RUBY_VERSION} | ||
|
||
ARG BUNDLER_VERSION=2.3 | ||
ARG UNAME=app | ||
ARG UID=1000 | ||
ARG GID=1000 | ||
|
@@ -8,38 +11,24 @@ LABEL maintainer="[email protected]" | |
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ | ||
apt-transport-https | ||
|
||
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - | ||
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - | ||
|
||
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ | ||
nodejs \ | ||
vim | ||
|
||
#so wait-for works | ||
RUN apt install -y netcat | ||
vim-tiny | ||
|
||
RUN gem install bundler:2.1.4 | ||
RUN gem install bundler:${BUNDLER_VERSION} | ||
|
||
|
||
RUN groupadd -g ${GID} -o ${UNAME} | ||
RUN useradd -m -d /app -u ${UID} -g ${GID} -o -s /bin/bash ${UNAME} | ||
RUN mkdir -p /gems && chown ${UID}:${GID} /gems | ||
|
||
|
||
COPY --chown=${UID}:${GID} Gemfile* /app/ | ||
USER $UNAME | ||
|
||
ENV BUNDLE_PATH /gems | ||
|
||
ENV ALMA_API_KEY YOUR_ALMA_API_KEY | ||
ENV ALMA_API_HOST http://falma:4567 | ||
ENV CIRC_REPORT_PATH /circ/report/path | ||
ENV PATRON_REPORT_PATH /patron/report/path | ||
ENV MYSQL_ROOT_PASSWORD mysqlrootpassword | ||
ENV DATABASE_HOST database | ||
ENV PUSHMON_URL YOUR_PUSHMON_URL | ||
|
||
WORKDIR /app | ||
RUN bundle install | ||
|
||
COPY --chown=${UID}:${GID} . /app | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
ARG RUBY_VERSION=3.1 | ||
FROM ruby:${RUBY_VERSION} | ||
|
||
ARG BUNDLER_VERSION=2.3 | ||
ARG UNAME=app | ||
ARG UID=1000 | ||
ARG GID=1000 | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ | ||
apt-transport-https | ||
|
||
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - | ||
|
||
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ | ||
nodejs \ | ||
vim-tiny | ||
|
||
RUN gem install bundler:${BUNDLER_VERSION} | ||
|
||
RUN groupadd -g ${GID} -o ${UNAME} | ||
RUN useradd -m -d /app -u ${UID} -g ${GID} -o -s /bin/bash ${UNAME} | ||
RUN mkdir -p /gems && chown ${UID}:${GID} /gems | ||
|
||
|
||
COPY --chown=${UID}:${GID} Gemfile* /app/ | ||
USER $UNAME | ||
|
||
ENV BUNDLE_PATH /gems | ||
ENV BUNDLE_WITHOUT development:test | ||
|
||
WORKDIR /app | ||
RUN bundle _${BUNDLER_VERSION}_ install | ||
|
||
COPY --chown=${UID}:${GID} . /app | ||
|
||
CMD ["bin/rails", "s", "-b", "0.0.0.0"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.