Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update extra contents #37

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions extra/Dockerfile_27

This file was deleted.

5 changes: 3 additions & 2 deletions extra/Dockerfile_30
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM ruby:3.0-alpine
FROM ruby:3.0-slim

ARG DB_TEST

RUN apk add --no-cache --update build-base dpkg gcompat mysql-dev postgresql-dev tzdata
RUN apt-get update
RUN apt-get install --no-install-recommends -y build-essential curl file git nano netcat libmariadb-dev libpq-dev openssl tzdata

# App setup
WORKDIR /usr/src/app
Expand Down
6 changes: 3 additions & 3 deletions extra/Dockerfile_26 → extra/Dockerfile_32
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ruby:2.6-alpine
FROM ruby:3.2-slim

ARG DB_TEST

RUN apk add --no-cache --update build-base dpkg gcompat mysql-dev postgresql-dev tzdata
RUN gem install bundler
RUN apt-get update
RUN apt-get install --no-install-recommends -y build-essential curl file git nano netcat-traditional libmariadb-dev libpq-dev openssl tzdata

# App setup
WORKDIR /usr/src/app
Expand Down
8 changes: 3 additions & 5 deletions extra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ DB_TEST=postgres RAILS=7.0 bin/appraisal rails-7_0-postgres rails db:drop db:cre

```sh
# Run a specific test configuration
docker-compose up --abort-on-container-exit -- tests_26_mysql
docker-compose up --abort-on-container-exit -- tests_26_pg
docker-compose up --abort-on-container-exit -- tests_27_mysql
docker-compose up --abort-on-container-exit -- tests_27_pg
docker compose up --abort-on-container-exit -- tests_30_mysql
docker compose up --abort-on-container-exit -- tests_30_postgres
# Cleanup (also removing local images):
docker-compose down --rmi local
docker compose down --rmi local
```
38 changes: 12 additions & 26 deletions extra/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ x-defaults:
MYSQL_DB_NAME: test_db
MYSQL_DB_USERNAME: root
MYSQL_DB_PASSWORD: password
RAILS: '7.0'
RAILS_ENV: test
command:
- sh
Expand All @@ -19,7 +20,7 @@ x-defaults:
while ! nc -z $${DB_TEST} $${DB_PORT} </dev/null
do echo "Waiting for DB ($${DB_TEST})..." && sleep 5; done
echo "DB is now available!"
cd spec/dummy
cd spec/dummy70
bin/setup
cd ../..
bin/rspec
Expand All @@ -37,6 +38,7 @@ x-defaults:
PG_DB_NAME: test_db
PG_DB_USERNAME: postgres
PG_DB_PASSWORD: password
RAILS: '7.0'
RAILS_ENV: test
command:
- sh
Expand All @@ -45,7 +47,7 @@ x-defaults:
while ! nc -z $${DB_TEST} $${DB_PORT} </dev/null
do echo "Waiting for DB ($${DB_TEST})..." && sleep 5; done
echo "DB is now available!"
cd spec/dummy
cd spec/dummy70
bin/setup
cd ../..
bin/rspec
Expand All @@ -66,50 +68,34 @@ services:
environment:
MYSQL_ROOT_PASSWORD: password

tests_26_mysql:
<<: *tests_mysql
build:
context: ..
dockerfile: extra/Dockerfile_26
args:
DB_TEST: mysql

tests_26_postgres:
<<: *tests_postgres
build:
context: ..
dockerfile: extra/Dockerfile_26
args:
DB_TEST: postgres

tests_27_mysql:
tests_30_mysql:
<<: *tests_mysql
build:
context: ..
dockerfile: extra/Dockerfile_27
dockerfile: extra/Dockerfile_30
args:
DB_TEST: mysql

tests_27_postgres:
tests_30_postgres:
<<: *tests_postgres
build:
context: ..
dockerfile: extra/Dockerfile_27
dockerfile: extra/Dockerfile_30
args:
DB_TEST: postgres

tests_30_mysql:
tests_32_mysql:
<<: *tests_mysql
build:
context: ..
dockerfile: extra/Dockerfile_30
dockerfile: extra/Dockerfile_32
args:
DB_TEST: mysql

tests_30_postgres:
tests_32_postgres:
<<: *tests_postgres
build:
context: ..
dockerfile: extra/Dockerfile_30
dockerfile: extra/Dockerfile_32
args:
DB_TEST: postgres
Loading