From 0bbb65a56598e7793e30e55e8959209d43f929d6 Mon Sep 17 00:00:00 2001 From: dl-maura Date: Wed, 6 Dec 2023 16:31:43 -0500 Subject: [PATCH 01/23] Create Dockerfile --- .docker/app/Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .docker/app/Dockerfile diff --git a/.docker/app/Dockerfile b/.docker/app/Dockerfile new file mode 100644 index 000000000..059be3d20 --- /dev/null +++ b/.docker/app/Dockerfile @@ -0,0 +1,28 @@ +ARG ALPINE_RUBY_VERSION + +FROM ruby:${ALPINE_RUBY_VERSION}-alpine + +RUN apk add --update --no-cache \ + bash \ + build-base \ + git \ + libxml2-dev \ + libxslt-dev \ + nodejs \ + shared-mime-info \ + sqlite-dev \ + tzdata \ + yarn + +RUN mkdir /app +WORKDIR /app + +RUN gem update --system && \ + gem install bundler && \ + bundle config build.nokogiri --use-system-libraries + +COPY . . + +EXPOSE 3000 + +CMD [".docker/app/entrypoint.sh"] From 105931a690b462a0fd7101beafd4d9641755d714 Mon Sep 17 00:00:00 2001 From: Maura C Date: Thu, 7 Dec 2023 10:33:27 -0500 Subject: [PATCH 02/23] Failing on sqlite3 due to a path change --- .docker/app/Dockerfile | 2 ++ .docker/app/entrypoint.sh | 6 ++++++ .env | 6 ++++++ 3 files changed, 14 insertions(+) create mode 100755 .docker/app/entrypoint.sh create mode 100644 .env diff --git a/.docker/app/Dockerfile b/.docker/app/Dockerfile index 059be3d20..f3cff53bb 100644 --- a/.docker/app/Dockerfile +++ b/.docker/app/Dockerfile @@ -5,11 +5,13 @@ FROM ruby:${ALPINE_RUBY_VERSION}-alpine RUN apk add --update --no-cache \ bash \ build-base \ + gcompat \ git \ libxml2-dev \ libxslt-dev \ nodejs \ shared-mime-info \ + sqlite \ sqlite-dev \ tzdata \ yarn diff --git a/.docker/app/entrypoint.sh b/.docker/app/entrypoint.sh new file mode 100755 index 000000000..654f4cd0f --- /dev/null +++ b/.docker/app/entrypoint.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -e + +rm -f /app/.internal_test_app/tmp/pids/server.pid +bundle install +exec bundle exec rake arclight:server["-p 3000 -b 0.0.0.0"] \ No newline at end of file diff --git a/.env b/.env new file mode 100644 index 000000000..d4e60bdd6 --- /dev/null +++ b/.env @@ -0,0 +1,6 @@ +ALPINE_RUBY_VERSION=3.2.2 +RAILS_VERSION=7.1.2 +VIEW_COMPONENT_VERSION=3.8.0 +SOLR_PORT=8983 +SOLR_URL=http://solr:8983/solr/arclight +SOLR_VERSION=latest From 29e04a4627945eeaf732127f6a5c6e6fd29d1fec Mon Sep 17 00:00:00 2001 From: Maura C Date: Thu, 7 Dec 2023 10:33:55 -0500 Subject: [PATCH 03/23] docker compose --- docker-compose.yml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3d6d221cf..e36ffa6e7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,39 @@ version: "3.7" services: + app: + build: + context: . + dockerfile: .docker/app/Dockerfile + args: + - ALPINE_RUBY_VERSION + # mounting . is causing seg-fault on macosx + #volumes: + #- .:/app + depends_on: + - solr + ports: + - "3000:3000" + environment: + - SOLR_URL # Set via environment variable or use default defined in .env file + - RAILS_VERSION # Set via environment variable or use default defined in .env file + - VIEW_COMPONENT_VERSION # Set via environment variable or use default defined in .env file + - SOLR_ENV=docker-compose + - ENGINE_CART_RAILS_OPTIONS=--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test --skip-solr + solr: - image: solr:latest + environment: + - SOLR_PORT # Set via environment variable or use default defined in .env file + - SOLR_VERSION # Set via environment variable or use default defined in .env file + image: "solr:${SOLR_VERSION}" volumes: - - $PWD/solr/conf:/opt/solr/conf + - $PWD/lib/generators/blacklight/templates/solr/conf:/opt/solr/conf ports: - - 8983:8983 + - "${SOLR_PORT}:8983" entrypoint: - docker-entrypoint.sh - solr-precreate - blacklight-core - /opt/solr/conf - "-Xms256m" - - "-Xmx512m" + - "-Xmx512m" \ No newline at end of file From 06d92b5e200e76649c0b387603dae5cf0014869d Mon Sep 17 00:00:00 2001 From: Maura C Date: Thu, 7 Dec 2023 14:23:59 -0500 Subject: [PATCH 04/23] fix solr path --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e36ffa6e7..b228a2168 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,13 +27,13 @@ services: - SOLR_VERSION # Set via environment variable or use default defined in .env file image: "solr:${SOLR_VERSION}" volumes: - - $PWD/lib/generators/blacklight/templates/solr/conf:/opt/solr/conf + - ./solr/conf:/opt/solr/conf ports: - "${SOLR_PORT}:8983" entrypoint: - docker-entrypoint.sh - solr-precreate - - blacklight-core + - arclight-core - /opt/solr/conf - "-Xms256m" - "-Xmx512m" \ No newline at end of file From 51534da12fda733d3d1dfaa58cfdfc3ad6495ded Mon Sep 17 00:00:00 2001 From: Maura C Date: Thu, 7 Dec 2023 14:34:52 -0500 Subject: [PATCH 05/23] load .env --- docker-compose.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b228a2168..fc3dedd9f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,8 @@ services: #- .:/app depends_on: - solr + env_file: + - .env ports: - "3000:3000" environment: @@ -28,12 +30,14 @@ services: image: "solr:${SOLR_VERSION}" volumes: - ./solr/conf:/opt/solr/conf + env_file: + - .env ports: - "${SOLR_PORT}:8983" entrypoint: - docker-entrypoint.sh - solr-precreate - - arclight-core + - arclight - /opt/solr/conf - "-Xms256m" - - "-Xmx512m" \ No newline at end of file + - "-Xmx512m" From 4c69302c9b7b8595f5ff9df9ff4008089f702111 Mon Sep 17 00:00:00 2001 From: Maura C Date: Thu, 7 Dec 2023 15:00:47 -0500 Subject: [PATCH 06/23] Dokcer solr support? --- tasks/arclight.rake | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/tasks/arclight.rake b/tasks/arclight.rake index 7cc11d7a4..fb7c7688f 100644 --- a/tasks/arclight.rake +++ b/tasks/arclight.rake @@ -41,14 +41,33 @@ namespace :arclight do Rake::Task['engine_cart:generate'].invoke end - print 'Starting Solr...' - SolrWrapper.wrap do |solr| - puts 'done.' - solr.with_collection do - Rake::Task['arclight:seed'].invoke + if ENV['SOLR_ENV'] == 'docker-compose' + puts "Using docker solr" + within_test_app do + system "bundle exec rails s #{args[:rails_server_args]}" + end + elsif system('docker-compose -v') + # We're not running docker-compose up but still want to use a docker instance of solr. + begin + puts "Starting Solr" + system_with_error_handling "docker-compose up -d solr" within_test_app do system "bundle exec rails s #{args[:rails_server_args]}" end + ensure + puts "Stopping Solr" + system_with_error_handling "docker-compose stop solr" + end + else + print 'Starting Solr...' + SolrWrapper.wrap do |solr| + puts 'done.' + solr.with_collection do + Rake::Task['arclight:seed'].invoke + within_test_app do + system "bundle exec rails s #{args[:rails_server_args]}" + end + end end end end From d2128124955f62335ad3c2f1c529babfa83ba7df Mon Sep 17 00:00:00 2001 From: Maura C Date: Thu, 7 Dec 2023 15:26:12 -0500 Subject: [PATCH 07/23] Lets try this --- .docker/app/Dockerfile | 1 - .docker/app/entrypoint.sh | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.docker/app/Dockerfile b/.docker/app/Dockerfile index f3cff53bb..a0b3473f2 100644 --- a/.docker/app/Dockerfile +++ b/.docker/app/Dockerfile @@ -11,7 +11,6 @@ RUN apk add --update --no-cache \ libxslt-dev \ nodejs \ shared-mime-info \ - sqlite \ sqlite-dev \ tzdata \ yarn diff --git a/.docker/app/entrypoint.sh b/.docker/app/entrypoint.sh index 654f4cd0f..8e037b975 100755 --- a/.docker/app/entrypoint.sh +++ b/.docker/app/entrypoint.sh @@ -2,5 +2,7 @@ set -e rm -f /app/.internal_test_app/tmp/pids/server.pid +bundle exec rails engine_cart:generate bundle install +#sleep 1000000000 exec bundle exec rake arclight:server["-p 3000 -b 0.0.0.0"] \ No newline at end of file From 12e86a4ce6c74ef8612ddf1ef0f9596b2d1f6655 Mon Sep 17 00:00:00 2001 From: Maura C Date: Thu, 7 Dec 2023 15:28:14 -0500 Subject: [PATCH 08/23] Bundle install --- .docker/app/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/app/entrypoint.sh b/.docker/app/entrypoint.sh index 8e037b975..c9d2058ad 100755 --- a/.docker/app/entrypoint.sh +++ b/.docker/app/entrypoint.sh @@ -2,7 +2,7 @@ set -e rm -f /app/.internal_test_app/tmp/pids/server.pid +bundle install bundle exec rails engine_cart:generate bundle install -#sleep 1000000000 exec bundle exec rake arclight:server["-p 3000 -b 0.0.0.0"] \ No newline at end of file From f8a986588963b5e8c44cc70d4a4ada2e378d3a0c Mon Sep 17 00:00:00 2001 From: dl-maura Date: Fri, 8 Dec 2023 11:31:59 -0500 Subject: [PATCH 09/23] Update arclight.rake --- tasks/arclight.rake | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/tasks/arclight.rake b/tasks/arclight.rake index fb7c7688f..fdb1a0c16 100644 --- a/tasks/arclight.rake +++ b/tasks/arclight.rake @@ -78,13 +78,24 @@ namespace :arclight do Dir.glob('spec/fixtures/ead/*').each do |dir| next unless File.directory?(dir) - within_test_app do - # Sets the REPOSITORY_ID to the name of the file's containing directory - system("REPOSITORY_ID=#{File.basename(dir)} " \ - "REPOSITORY_FILE=#{Arclight::Engine.root}/spec/fixtures/config/repositories.yml " \ - "DIR=#{Arclight::Engine.root}/#{dir} " \ - 'SOLR_URL=http://127.0.0.1:8983/solr/blacklight-core ' \ - 'rake arclight:index_dir') + if ENV['SOLR_ENV'] == 'docker-compose' or system('docker-compose -v') + within_test_app do + # Sets the REPOSITORY_ID to the name of the file's containing directory + system("REPOSITORY_ID=#{File.basename(dir)} " \ + "REPOSITORY_FILE=#{Arclight::Engine.root}/spec/fixtures/config/repositories.yml " \ + "DIR=#{Arclight::Engine.root}/#{dir} " \ + 'SOLR_URL=http://solr:8983/solr/arclight ' \ + 'rake arclight:index_dir') + end + else + within_test_app do + # Sets the REPOSITORY_ID to the name of the file's containing directory + system("REPOSITORY_ID=#{File.basename(dir)} " \ + "REPOSITORY_FILE=#{Arclight::Engine.root}/spec/fixtures/config/repositories.yml " \ + "DIR=#{Arclight::Engine.root}/#{dir} " \ + 'SOLR_URL=http://127.0.0.1:8983/solr/blacklight-core ' \ + 'rake arclight:index_dir') + end end end end From f62e8dff0d1f95153e0515dd0d10863198d6801a Mon Sep 17 00:00:00 2001 From: Maura C Date: Fri, 8 Dec 2023 12:17:38 -0500 Subject: [PATCH 10/23] Entrypoint with seed file --- .docker/app/entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/app/entrypoint.sh b/.docker/app/entrypoint.sh index c9d2058ad..a0095f95b 100755 --- a/.docker/app/entrypoint.sh +++ b/.docker/app/entrypoint.sh @@ -4,5 +4,5 @@ set -e rm -f /app/.internal_test_app/tmp/pids/server.pid bundle install bundle exec rails engine_cart:generate -bundle install -exec bundle exec rake arclight:server["-p 3000 -b 0.0.0.0"] \ No newline at end of file +bundle exec rails arclight:seed +bundle exec rake arclight:server["-p 3000 -b 0.0.0.0"] \ No newline at end of file From efb7a1204121e835a1deb23a01073c863b7a7e7a Mon Sep 17 00:00:00 2001 From: Maura C Date: Fri, 8 Dec 2023 12:56:29 -0500 Subject: [PATCH 11/23] Using solr env --- tasks/arclight.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/arclight.rake b/tasks/arclight.rake index fdb1a0c16..2fd3e472a 100644 --- a/tasks/arclight.rake +++ b/tasks/arclight.rake @@ -78,13 +78,13 @@ namespace :arclight do Dir.glob('spec/fixtures/ead/*').each do |dir| next unless File.directory?(dir) - if ENV['SOLR_ENV'] == 'docker-compose' or system('docker-compose -v') + if ENV['SOLR_ENV'] == 'docker-compose' within_test_app do # Sets the REPOSITORY_ID to the name of the file's containing directory system("REPOSITORY_ID=#{File.basename(dir)} " \ "REPOSITORY_FILE=#{Arclight::Engine.root}/spec/fixtures/config/repositories.yml " \ "DIR=#{Arclight::Engine.root}/#{dir} " \ - 'SOLR_URL=http://solr:8983/solr/arclight ' \ + "SOLR_URL=#{ENV['SOLR_URL']} " \ 'rake arclight:index_dir') end else From 5b5df670c94c44156d39cce8fdee692b119e163b Mon Sep 17 00:00:00 2001 From: Maura C Date: Fri, 8 Dec 2023 12:57:16 -0500 Subject: [PATCH 12/23] Final rake task --- tasks/arclight.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/arclight.rake b/tasks/arclight.rake index 2fd3e472a..f335f6478 100644 --- a/tasks/arclight.rake +++ b/tasks/arclight.rake @@ -78,7 +78,7 @@ namespace :arclight do Dir.glob('spec/fixtures/ead/*').each do |dir| next unless File.directory?(dir) - if ENV['SOLR_ENV'] == 'docker-compose' + if ENV['SOLR_ENV'] == 'docker-compose' or system('docker-compose -v') within_test_app do # Sets the REPOSITORY_ID to the name of the file's containing directory system("REPOSITORY_ID=#{File.basename(dir)} " \ From e2b8d54751536980da281f35956cb24a2e93ebea Mon Sep 17 00:00:00 2001 From: dl-maura Date: Fri, 8 Dec 2023 13:14:57 -0500 Subject: [PATCH 13/23] Update README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 83a8bc510..aa6af9716 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,21 @@ Then visit http://localhost:3000. It will also start a Solr instance on port 898 You can also run `bin/console` for an interactive prompt that will allow you to experiment. +### Docker Development Environment + +Another option for a local development environment is to use the included docker materials to spin up a local dockerized devleopment instance. After cloning this repository, run the following command inside the project directory: + +```sh +$ docker compose up +``` +This should bring up a dockerized solr and arclight running at ports 8983 and 3000, with the seed data indexed. + +NOTE: If you are on an m1/m2 mac, you will have to do the following first: + +```sh +$ export DOCKER_DEFAULT_PLATFORM=linux/amd64 +``` + ### Releasing #### To release a new gem: From 096d894827a224f6fdf9542c9643f20916a53669 Mon Sep 17 00:00:00 2001 From: dl-maura Date: Fri, 8 Dec 2023 13:15:16 -0500 Subject: [PATCH 14/23] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa6af9716..70455cda1 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ $ docker compose up ``` This should bring up a dockerized solr and arclight running at ports 8983 and 3000, with the seed data indexed. -NOTE: If you are on an m1/m2 mac, you will have to do the following first: +NOTE: If you are on an M1/M2 mac, you will have to do the following first: ```sh $ export DOCKER_DEFAULT_PLATFORM=linux/amd64 From 9ccd9b8fa7ccaa00d69f64c040a9d17a84ff0521 Mon Sep 17 00:00:00 2001 From: Maura C Date: Fri, 8 Dec 2023 16:26:27 -0500 Subject: [PATCH 15/23] Adding in the mount --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fc3dedd9f..837b1f569 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,8 +8,8 @@ services: args: - ALPINE_RUBY_VERSION # mounting . is causing seg-fault on macosx - #volumes: - #- .:/app + volumes: + - .:/app depends_on: - solr env_file: From 59ae625a753896f9c4ab2787182394396a25c608 Mon Sep 17 00:00:00 2001 From: dl-maura Date: Mon, 11 Dec 2023 09:06:17 -0500 Subject: [PATCH 16/23] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 70455cda1..f1fad51ea 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ Another option for a local development environment is to use the included docker ```sh $ docker compose up ``` -This should bring up a dockerized solr and arclight running at ports 8983 and 3000, with the seed data indexed. +This should bring up a dockerized solr and arclight running at ports 8983 and 3000, with the seed data indexed. This uses a mount which allows you to make changes in your IDE/text editor of choice and see them reflected in the running app without a restart. NOTE: If you are on an M1/M2 mac, you will have to do the following first: From 631b4c72e083d5713c5e4411d87fe16fd94f42a2 Mon Sep 17 00:00:00 2001 From: dl-maura Date: Mon, 11 Dec 2023 09:10:17 -0500 Subject: [PATCH 17/23] Update README.md --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f1fad51ea..810916336 100644 --- a/README.md +++ b/README.md @@ -107,19 +107,27 @@ You can also run `bin/console` for an interactive prompt that will allow you to ### Docker Development Environment +**NOTE:** If you are on an M1/M2 mac, you will have to do the following first: + +```sh +$ export DOCKER_DEFAULT_PLATFORM=linux/amd64 +``` + Another option for a local development environment is to use the included docker materials to spin up a local dockerized devleopment instance. After cloning this repository, run the following command inside the project directory: ```sh $ docker compose up ``` -This should bring up a dockerized solr and arclight running at ports 8983 and 3000, with the seed data indexed. This uses a mount which allows you to make changes in your IDE/text editor of choice and see them reflected in the running app without a restart. -NOTE: If you are on an M1/M2 mac, you will have to do the following first: +or for a full rebuild and with containers running in the background: ```sh -$ export DOCKER_DEFAULT_PLATFORM=linux/amd64 +$ docker-compose -f docker-compose.yml up --build -d --force-recreate ``` +Either should bring up a dockerized solr and arclight running at ports 8983 and 3000, with the seed data indexed. This uses a mount which allows you to make changes in your IDE/text editor of choice and see them reflected in the running app without a restart. + + ### Releasing #### To release a new gem: From 5139534000e46e9c6e30a023200c5a8ca3632550 Mon Sep 17 00:00:00 2001 From: dl-maura Date: Mon, 11 Dec 2023 09:11:36 -0500 Subject: [PATCH 18/23] Update README.md last of the typos? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 810916336..5390ffd82 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ You can also run `bin/console` for an interactive prompt that will allow you to $ export DOCKER_DEFAULT_PLATFORM=linux/amd64 ``` -Another option for a local development environment is to use the included docker materials to spin up a local dockerized devleopment instance. After cloning this repository, run the following command inside the project directory: +Another option for a local development environment is to use the included docker materials to spin up a local dockerized development instance. After cloning this repository, run the following command inside the project directory: ```sh $ docker compose up From 053a05f33d99b2115e4dfe7b4ebbf6efe2e5c71d Mon Sep 17 00:00:00 2001 From: Maura C Date: Tue, 12 Dec 2023 11:24:47 -0500 Subject: [PATCH 19/23] Switching to bookworm and explicitly setting the type of image to ahndle m1/m2 --- .docker/app/Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.docker/app/Dockerfile b/.docker/app/Dockerfile index a0b3473f2..fcca7d63c 100644 --- a/.docker/app/Dockerfile +++ b/.docker/app/Dockerfile @@ -1,17 +1,19 @@ ARG ALPINE_RUBY_VERSION -FROM ruby:${ALPINE_RUBY_VERSION}-alpine +FROM --platform=linux/amd64 ruby:${ALPINE_RUBY_VERSION}-bookworm -RUN apk add --update --no-cache \ +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update -qq && \ + apt-get install -y \ bash \ - build-base \ - gcompat \ + build-essential \ git \ libxml2-dev \ libxslt-dev \ nodejs \ shared-mime-info \ - sqlite-dev \ + sqlite3 \ tzdata \ yarn From fd492ac79422e3d73f0cc00aa6e48d22d8a5bc0f Mon Sep 17 00:00:00 2001 From: Maura C Date: Tue, 12 Dec 2023 11:26:49 -0500 Subject: [PATCH 20/23] Ran rubocop -A --- tasks/arclight.rake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tasks/arclight.rake b/tasks/arclight.rake index f335f6478..9652bf7ca 100644 --- a/tasks/arclight.rake +++ b/tasks/arclight.rake @@ -42,21 +42,21 @@ namespace :arclight do end if ENV['SOLR_ENV'] == 'docker-compose' - puts "Using docker solr" + puts 'Using docker solr' within_test_app do system "bundle exec rails s #{args[:rails_server_args]}" end elsif system('docker-compose -v') # We're not running docker-compose up but still want to use a docker instance of solr. begin - puts "Starting Solr" - system_with_error_handling "docker-compose up -d solr" + puts 'Starting Solr' + system_with_error_handling 'docker-compose up -d solr' within_test_app do system "bundle exec rails s #{args[:rails_server_args]}" end ensure - puts "Stopping Solr" - system_with_error_handling "docker-compose stop solr" + puts 'Stopping Solr' + system_with_error_handling 'docker-compose stop solr' end else print 'Starting Solr...' @@ -78,13 +78,13 @@ namespace :arclight do Dir.glob('spec/fixtures/ead/*').each do |dir| next unless File.directory?(dir) - if ENV['SOLR_ENV'] == 'docker-compose' or system('docker-compose -v') + if (ENV['SOLR_ENV'] == 'docker-compose') || system('docker-compose -v') within_test_app do # Sets the REPOSITORY_ID to the name of the file's containing directory system("REPOSITORY_ID=#{File.basename(dir)} " \ "REPOSITORY_FILE=#{Arclight::Engine.root}/spec/fixtures/config/repositories.yml " \ "DIR=#{Arclight::Engine.root}/#{dir} " \ - "SOLR_URL=#{ENV['SOLR_URL']} " \ + "SOLR_URL=#{ENV.fetch('SOLR_URL', nil)} " \ 'rake arclight:index_dir') end else @@ -95,7 +95,7 @@ namespace :arclight do "DIR=#{Arclight::Engine.root}/#{dir} " \ 'SOLR_URL=http://127.0.0.1:8983/solr/blacklight-core ' \ 'rake arclight:index_dir') - end + end end end end From 1d2fcd2553b9accc9c5b86d730d37528964138ec Mon Sep 17 00:00:00 2001 From: Maura C Date: Wed, 13 Dec 2023 10:16:52 -0500 Subject: [PATCH 21/23] Moving to blacklight-core for consistency --- .env | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index d4e60bdd6..2a64fc5fb 100644 --- a/.env +++ b/.env @@ -2,5 +2,5 @@ ALPINE_RUBY_VERSION=3.2.2 RAILS_VERSION=7.1.2 VIEW_COMPONENT_VERSION=3.8.0 SOLR_PORT=8983 -SOLR_URL=http://solr:8983/solr/arclight +SOLR_URL=http://solr:8983/solr/blacklight-core SOLR_VERSION=latest diff --git a/docker-compose.yml b/docker-compose.yml index 837b1f569..81d335aa3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,7 +37,7 @@ services: entrypoint: - docker-entrypoint.sh - solr-precreate - - arclight + - blacklight-core - /opt/solr/conf - "-Xms256m" - "-Xmx512m" From 8bc64bab01f841f08a1e9390a14a428a5f095db6 Mon Sep 17 00:00:00 2001 From: dl-maura Date: Thu, 14 Dec 2023 10:05:03 -0500 Subject: [PATCH 22/23] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5390ffd82..28eee834b 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ See the [CONTRIBUTORS](CONTRIBUTORS.md) file. ## Development -ArcLight requires Solr to be running. For development you can start this using `solr_wrapper` or you may choose to use Docker. Start Solr using Docker by doing `docker compose up`. +ArcLight requires Solr to be running. For development you can start this using `solr_wrapper` or you may choose to use Docker. Start Solr using Docker by doing `docker compose solr up`. ### Run the test suite @@ -128,7 +128,7 @@ $ docker-compose -f docker-compose.yml up --build -d --force-recreate Either should bring up a dockerized solr and arclight running at ports 8983 and 3000, with the seed data indexed. This uses a mount which allows you to make changes in your IDE/text editor of choice and see them reflected in the running app without a restart. -### Releasing +## Releasing #### To release a new gem: From a12cc9ed37169b7e657d86a163fc6fb49b98876d Mon Sep 17 00:00:00 2001 From: dl-maura Date: Thu, 14 Dec 2023 10:05:30 -0500 Subject: [PATCH 23/23] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 28eee834b..e74e6ef71 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ See the [CONTRIBUTORS](CONTRIBUTORS.md) file. ## Development -ArcLight requires Solr to be running. For development you can start this using `solr_wrapper` or you may choose to use Docker. Start Solr using Docker by doing `docker compose solr up`. +ArcLight requires Solr to be running. For development you can start this using `solr_wrapper` or you may choose to use Docker. Start Solr using Docker by doing `docker compose up solr`. ### Run the test suite