Skip to content

Instantly share code, notes, and snippets.

@hrysd
Last active March 19, 2021 10:28
Show Gist options
  • Save hrysd/48699eb463dd0f75bef96746e60a3073 to your computer and use it in GitHub Desktop.
Save hrysd/48699eb463dd0f75bef96746e60a3073 to your computer and use it in GitHub Desktop.
CPK を手元で動かす
$ docker-compose up -d
$ docker-compose run cpk bash
$ bundle install
$ bundle exec rake mysql:build_database
$ bundle exec rake mysql:test
$ bundle exec rake mysql:test TEST=/path/to/test
# To run tests:
# 1. Copy this file to test/connections/databases.yml.
# 2. Update to match the databases you want to test against.
ibm_db:
database: ocdpdev
username: db2inst1
password: password
host: localhost
mysql:
adapter: mysql2
username: root
database: composite_primary_keys_unittest
host: mysql
oracle:
adapter: oracle_enhanced
database: xe
username: SYSTEM
password: oracle
host: localhost
postgresql:
adapter: postgresql
database: composite_primary_keys_unittest
username: postgres
password: password
host: postgresql
sqlite:
adapter: sqlite3
database: <%= File.join(project_root, 'db', 'composite_primary_keys_unittest.sqlite') %>
sqlserver:
adapter: sqlserver
username: cpk
password: cpk
database: composite_primary_keys_unittest
host: localhost
port: 1433
version: '3'
services:
cpk:
build:
context: .
volumes:
- ./:/usr/src/app
- rubygems:/usr/local/bundle
depends_on:
- mysql
- pql
mysql:
image: mysql:5.6
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
volumes:
- mysql_data:/var/lib/mysql
pql:
image: postgres:13
environment:
POSTGRES_PASSWORD: password
volumes:
- postgres_data:/var/lib/postgresql/dat
volumes:
rubygems:
mysql_data:
postgres_data:
FROM rubylang/ruby:2.7.2-bionic
RUN apt-get update
RUN apt-get install -y build-essential libpq-dev mysql-client libmysqlclient-dev sqlite3 libsqlite3-dev
WORKDIR /usr/src/app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment