Skip to content

Commit 8274e01

Browse files
committed
Only use docker for solr and CI
1 parent 5f70b00 commit 8274e01

File tree

4 files changed

+29
-99
lines changed

4 files changed

+29
-99
lines changed

README.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,39 +77,54 @@ See the [Spotlight wiki](https://github.com/projectblacklight/spotlight/wiki) fo
7777
* The `main` branch is for development of the upcoming 5.0 release.
7878
* The `4.x` series is on the [release-4.x](https://github.com/projectblacklight/spotlight/tree/release-4.x) branch for backports of features and bug fixes.
7979

80-
## Spotlight
80+
## Tooling
8181

82-
* is a Rails engine and needs to be used in the context of a Rails application. We use [engine_cart](https://github.com/cbeer/engine_cart) to create an internal test application at .internal_test_app/
83-
* uses Solr as part of its integration tests. We use [solr_wrapper](https://github.com/cbeer/solr_wrapper) to manage the Solr instance used for development and test.
82+
* Spotlight is a Rails engine and needs to be used in the context of a Rails application. We use [engine_cart](https://github.com/cbeer/engine_cart) to create an internal test application at .internal_test_app/
83+
* Spotlight relies on Solr for its integration tests and to run a development instance. [solr_wrapper](https://github.com/cbeer/solr_wrapper) allows us to provide terse commands for development and testing. For more granular control you can run Solr in Docker, then execute services and processes individually.
8484

8585
See more detailed instructions for development environment setup at ["Contributing to Spotlight"](https://github.com/projectblacklight/spotlight/wiki/Contributing-to-Spotlight)
8686

8787
## Run a development server
8888

89-
### With EngineCart
90-
```
91-
$ rake spotlight:server
92-
```
89+
After following one of the instructions below, visit http://localhost:3000. A Solr instance will be running on port 8983. When using importmap (the default configuration), JavaScript changes in development should not require [bundling](#updating-the-javascript-bundle) or a server restart.
9390

94-
Then visit http://localhost:3000. A Solr instance will be running on port 8983. When using importmap (the default configuration), JavaScript changes in development should not require [bundling](#updating-the-javascript-bundle) or a server restart.
91+
### With solr_wrapper
92+
```sh
93+
rake spotlight:server
94+
```
9595

9696
### With Docker
9797

9898
```sh
99-
# because of how docker compose handles named images, running `docker compose up --build` will error when the Rails images have not been built locally
100-
docker compose build
101-
docker compose up
99+
docker compose up -d
100+
rake engine_cart:generate
101+
rake spotlight:fixtures
102+
cd .internal_test_app
103+
rake spotlight:seed_admin_user
104+
bin/dev
102105
```
103106

104107
## Tests
105108

106-
### Run all the tests:
109+
### With solr_wrapper
107110

111+
```sh
112+
rake
108113
```
109-
$ rake
114+
115+
This runs rubocop style enforcement and then all tests, starting solr and building the testing rails app automatically.
116+
117+
### With Docker
118+
119+
```sh
120+
docker compose up -d
121+
rake engine_cart:generate
122+
rake spotlight:fixtures
123+
cd .internal_test_app && rake spec:prepare && cd -
124+
rspec
110125
```
111126

112-
This utilizes Solr and the testing rails app automatically.
127+
Using rspec directly allows you to run individual test files / lines.
113128

114129
## Translations
115130

bin/db-migrate-seed.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

bin/docker-entrypoint.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

compose.yaml

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,4 @@
11
services:
2-
web:
3-
build:
4-
context: .
5-
image: spotlight
6-
stdin_open: true
7-
tty: true
8-
restart: always
9-
env_file:
10-
- .env
11-
volumes:
12-
- .:/spotlight/engine
13-
- spotlight_app:/spotlight/app
14-
ports:
15-
- 3000:3000
16-
depends_on:
17-
- db_migrate
18-
- solr
19-
networks:
20-
- spotlight
21-
22-
db_migrate:
23-
image: spotlight
24-
env_file:
25-
- .env
26-
environment:
27-
SKIP_TRANSLATION: "yes"
28-
entrypoint: sh -c '/spotlight/engine/bin/db-migrate-seed.sh'
29-
volumes:
30-
- .:/spotlight/engine
31-
- spotlight_app:/spotlight/app
32-
networks:
33-
- spotlight
34-
352
solr:
363
environment:
374
- SOLR_PORT # Set via environment variable or use default defined in .env file
@@ -47,14 +14,3 @@ services:
4714
- solr-precreate
4815
- blacklight-core
4916
- /opt/solr/conf
50-
networks:
51-
- spotlight
52-
53-
volumes:
54-
spotlight_app:
55-
56-
networks:
57-
spotlight:
58-
driver: bridge
59-
driver_opts:
60-
com.docker.network.bridge.name: br-spotlight

0 commit comments

Comments
 (0)