-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsolr-update-config
More file actions
executable file
·47 lines (40 loc) · 1.69 KB
/
solr-update-config
File metadata and controls
executable file
·47 lines (40 loc) · 1.69 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
46
47
#!/bin/sh
#ddev-generated
#annertech-ddev
## Description: Update SOLR config (config.zip), looks into Robo first to see if a project has a custom described action set for this.
## Usage: solr:update-config
## Example: "ddev solr:update-config"
## ProjectTypes: drupal10,drupal11
if ./vendor/bin/robo | grep -q 'solr:update-conf'; then
echo "Running via Robo (configuration found in project level)"
./vendor/bin/robo solr:update-conf
else
echo "Running via DDEV addon (no configuration found in project level)."
drush search-api-solr:get-server-config solr ../config.zip # Hardcode SOLR version? (8.11)
# DDEV
rm .ddev/solr/conf/*
unzip config.zip -d .ddev/solr/conf/
# @note: This was needed at some point, keep for reference:
# sed -i "/solr\.install\.dir/d" .ddev/solr/conf/*
# PSH
rm .platform/solr-conf/8.x/*
unzip config.zip -d .platform/solr-conf/8.x/
rm config.zip
fi
#########################################################################################
# Sample configuration for RoboFile.php #
#########################################################################################
# /**
# * Get config.zip for SOLR and extract to PSH and DDEV.
# */
# public function solrUpdateConf() {
# $this->taskExec('drush search-api-solr:get-server-config solr ../config.zip 8.11')
# ->run();
# // DDEV
# $this->taskExec('rm .ddev/solr/conf/*')->run();
# $this->taskExec('unzip config.zip -d .ddev/solr/conf/')->run();
# // PSH
# $this->taskExec('rm .platform/solr-conf/8.x/*')->run();
# $this->taskExec('unzip config.zip -d .platform/solr-conf/8.x/')->run();
# $this->taskExec('rm config.zip')->run();
# }