Skip to content

Commit

Permalink
Added Solr to Lando with a script to fetch the latest Solr config (#86
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-cox authored Oct 19, 2022
1 parent 9ac0b9b commit 36856a8
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,8 @@
# Ignore Lando overrides
.lando.local.yml

# Ignore Lando Solr config
/.lando/solr

# Ignore temp files
/.phpunit.result.cache
10 changes: 10 additions & 0 deletions .lando.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ proxy:
- mail.localgov.lndo.site
adminer:
- adminer.localgov.lndo.site
solr-sitewide:
- 'solr-sitewide.localgov.lndo.site:8983'
services:
appserver:
overrides:
Expand Down Expand Up @@ -56,6 +58,11 @@ services:
expose:
- '4444'
command: ["/usr/local/bin/supervisord", "-c", "/etc/supervisord.conf"]
solr-sitewide:
type: solr:8
core: sitewide
config:
dir: .lando/solr/localgov_sitewide_solr
tooling:
deprecated:
service: appserver
Expand Down Expand Up @@ -93,3 +100,6 @@ tooling:
service: node
yarn:
service: node
update-solr-config:
service: appserver
cmd: /app/.lando/update-solr-config.sh
21 changes: 21 additions & 0 deletions .lando/update-solr-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

##
# Update Lando Solr config.
##

for SERVER in `drush search-api:server-list --field=ID | grep solr`; do
echo "Fetching Solr config for ${SERVER}."
mkdir -p ".lando/solr/${SERVER}"
drush search-api-solr:get-server-config ${SERVER} "/tmp/${SERVER}.zip"
unzip -qo "/tmp/${SERVER}.zip" -d ".lando/solr/${SERVER}"
rm "/tmp/${SERVER}.zip"
UPDATED=true
done

if [ "$UPDATED" = true ]; then
echo "
For the new Solr config to be recognized you must restart Lando."
else
echo "No Solr servers found."
fi
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"drupal/core-composer-scaffold": "^9.1",
"drupal/core-project-message": "^9.1",
"drupal/core-recommended": "^9.1",
"localgovdrupal/localgov": "^2.0"
"localgovdrupal/localgov": "^2.0",
"localgovdrupal/localgov_search_solr": "^1.0@alpha"
},
"require-dev": {
"brianium/paratest": "^6.0",
Expand Down

0 comments on commit 36856a8

Please sign in to comment.