diff --git a/config/config.yml b/config/config.yml index 3f08edd..308507c 100644 --- a/config/config.yml +++ b/config/config.yml @@ -19,10 +19,3 @@ dest_parent_dir: :pd_open: '/tmp/datasets/ht_text_pd_open_access' :pd_world: '/tmp/datasets/ht_text_pd_world' :pd_world_open: '/tmp/datasets/ht_text_pd_world_open_access' - -db: - adapter: mysql2 - database: ht - host: mariadb-dev - user: datasets - password: datasets diff --git a/config/hathitrust_config.rb b/config/hathitrust_config.rb index d6915c0..6efb0c7 100644 --- a/config/hathitrust_config.rb +++ b/config/hathitrust_config.rb @@ -47,9 +47,14 @@ def volume_repo end def db_connection - # Example with logging enabled - # @db_connection ||= Sequel.connect(db.merge({loggers: [Logger.new($stdout)]})) - @db_connection ||= Sequel.connect(db) + @db_connection ||= Sequel.connect( + adapter: "mysql2", + user: ENV["MARIADB_HT_RO_USERNAME"], + password: ENV["MARIADB_HT_RO_PASSWORD"], + host: ENV["MARIADB_HT_RO_HOST"], + database: ENV["MARIADB_HT_RO_DATABASE"], + encoding: "utf8mb4" + ) end def filter diff --git a/docker-compose.yml b/docker-compose.yml index 57777e8..fdab5d1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,14 @@ x-healthcheck-defaults: &healthcheck-defaults start_period: 10s retries: 5 +x-environment: &environment + REDIS_URL: redis://redis/ + PREVIEW_EMAIL: true + MARIADB_HT_RO_HOST: mariadb-dev + MARIADB_HT_RO_USERNAME: datasets + MARIADB_HT_RO_PASSWORD: datasets + MARIADB_HT_RO_DATABASE: ht + x-common-service: &common-service build: context: . @@ -16,9 +24,7 @@ x-common-service: &common-service - .:/usr/src/app - gem_cache:/gems - ./example/datasets:/tmp/datasets - environment: - REDIS_URL: redis://redis/ - PREVIEW_EMAIL: true + environment: *environment services: @@ -29,6 +35,9 @@ services: depends_on: redis: *healthy mariadb-test: *healthy + environment: + <<: *environment + MARIADB_HT_RO_HOST: mariadb-test processor: <<: *common-service diff --git a/lib/datasets.rb b/lib/datasets.rb index 8828f0b..310e30a 100644 --- a/lib/datasets.rb +++ b/lib/datasets.rb @@ -1,5 +1,3 @@ -require "datasets/version" - require "datasets/configuration" require "datasets/job" require "datasets/jobs/delete_job" diff --git a/lib/datasets/version.rb b/lib/datasets/version.rb deleted file mode 100644 index 778981e..0000000 --- a/lib/datasets/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module Datasets - VERSION = "0.1.0" -end diff --git a/spec/support/config/integration.yml b/spec/support/config/integration.yml index c55fea8..bd59d3f 100644 --- a/spec/support/config/integration.yml +++ b/spec/support/config/integration.yml @@ -18,10 +18,3 @@ dest_parent_dir: :pd_open: '/tmp/integration/datasets/ht_text_pd_open_access' :pd_world: '/tmp/integration/datasets/ht_text_pd_world' :pd_world_open: '/tmp/integration/datasets/ht_text_pd_world_open_access' - -db: - adapter: mysql2 - database: ht - host: mariadb-test - user: datasets - password: datasets