Repository navigation
Expand file tree
/
Copy pathdevbox.json
More file actions
45 lines (45 loc) · 2.49 KB
/
Copy pathdevbox.json
File metadata and controls
45 lines (45 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json",
"packages": [
"ruby@3.4.1",
"jdk@19.0.2",
"pkg-config@latest",
"libffi@latest",
"clang@latest",
"git@latest",
"path:flakes/solr#default"
],
"shell": {
"init_hook": [
"echo 'Welcome to devbox!' > /dev/null"
],
"scripts": {
"bundle": "bundle install",
"spec": [
"devbox run setup",
"bundle exec rspec"
],
"cap": "bundle exec cap -T",
"setup": [
"devbox run bundle",
"lsof -i -sTCP:LISTEN | grep 8983 || if [[ -z $SOLR_PORT ]] ; then echo 'There is already something running on port 8983, export SOLR_PORT=8999 or similar to choose a different port' && exit 1; fi",
"devbox services up -b && sleep 5 || echo 'services are already running'",
"devbox run create_solr_collections"
],
"create_solr_collections": [
"[ $(curl -s -o /dev/null -w '%{http_code}' http://localhost:${SOLR_PORT:-8983}/solr/blacklight-core/admin/ping) -eq '200' ] || solr create_core -c blacklight-core -d solr_configs/catalog-production-v3 -p ${SOLR_PORT:-8983}",
"[ $(curl -s -o /dev/null -w '%{http_code}' http://localhost:${SOLR_PORT:-8983}/solr/dss-core/admin/ping) -eq '200' ] || solr create_core -c dss-core -d solr_configs/dss-production -p ${SOLR_PORT:-8983}",
"[ $(curl -s -o /dev/null -w '%{http_code}' http://localhost:${SOLR_PORT:-8983}/solr/pulmap-core/admin/ping) -eq '200' ] || solr create_core -c pulmap-core -d solr_configs/pulmap -p ${SOLR_PORT:-8983}"
],
"delete_solr_collections": [
"curl -X POST http://localhost:${SOLR_PORT:-8983}/api/cores/blacklight-core/unload -H 'Content-Type: application/json' -d '{\"deleteIndex\":true,\"deleteDataDir\":true,\"deleteInstanceDir\":true}' || echo 'pulmap core was already deleted'",
"curl -X POST http://localhost:${SOLR_PORT:-8983}/api/cores/dss-core/unload -H 'Content-Type: application/json' -d '{\"deleteIndex\":true,\"deleteDataDir\":true,\"deleteInstanceDir\":true}' || echo 'pulmap core was already deleted'",
"curl -X POST http://localhost:${SOLR_PORT:-8983}/api/cores/pulmap-core/unload -H 'Content-Type: application/json' -d '{\"deleteIndex\":true,\"deleteDataDir\":true,\"deleteInstanceDir\":true}' || echo 'pulmap core was already deleted'"
],
"recreate_solr_collections": [
"devbox run delete_solr_collections",
"devbox run create_solr_collections"
]
}
}
}