Skip to content

Commit e4882d4

Browse files
authored
[GOVCMS-13521] Ensure solr index is created on first run (#526) (#527)
After the solr9 upgrade, the entrypoint was failing with the error "cp: cannot create directory '/var/solr/data/drupal': No such file or directory". After adding the instruction to create the `/var/solr/data` directory, local tests no longer show the error.
1 parent 1086342 commit e4882d4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.docker/images/solr/900-prepare-index.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/bash
22

3+
set -eu
4+
35
# Prepare the index.
46
#
57
# If the release requires a configset update then an
@@ -9,6 +11,7 @@
911

1012
INDEX="${INDEX:-drupal}"
1113
CONFIGSET="${CONFIGSET:-/opt/solr/server/solr/configsets/drupal}"
14+
GOVCMS_SOLR_RECREATE="${GOVCMS_SOLR_RECREATE:-}"
1215

1316
# The following scripts are provided by the base images.
1417
if [ -n "$GOVCMS_SOLR_RECREATE" ]; then
@@ -18,5 +21,6 @@ if [ -n "$GOVCMS_SOLR_RECREATE" ]; then
1821
else
1922
# solr-precreate will initialise the solr data/conf directories
2023
# if they exist on disk, this will skip.
24+
mkdir -p /var/solr/data
2125
solr-precreate "$INDEX" "$CONFIGSET"
2226
fi

0 commit comments

Comments
 (0)