Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ezsystems/launchpad
Browse files Browse the repository at this point in the history
  • Loading branch information
Plopix committed Nov 20, 2018
2 parents decdda3 + 53e0306 commit 1bcf8fd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
Binary file modified docs/ez.phar
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/ez.phar.version
@@ -1 +1 @@
ea4141022695c04561cdbc683971d6eab79a28c5 ez.phar
c199849c04f824633dbf0af519379d950a56b72e ez.phar
38 changes: 33 additions & 5 deletions payload/dev/solr/entrypoint.bash
@@ -1,5 +1,14 @@
#!/usr/bin/env bash

# Check if missing template folder
DESTINATION_EZ="/ezsolr/server/ez"
DESTINATION_TEMPLATE="$DESTINATION_EZ/template"
if [ ! -d ${DESTINATION_TEMPLATE} ]; then
cd $PROJECTMAPPINGFOLDER/ezplatform
mkdir -p $DESTINATION_TEMPLATE
cp -R vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/* $DESTINATION_TEMPLATE
fi

mkdir -p /ezsolr/server/ez
if [ ! -f /ezsolr/server/ez/solr.xml ]; then
cp /opt/solr/server/solr/solr.xml /ezsolr/server/ez
Expand All @@ -9,11 +18,30 @@ if [ ! -f /ezsolr/server/ez/solr.xml ]; then
sed -i -e 's/<dataDir>${solr.data.dir:}<\/dataDir>/<dataDir>\/opt\/solr\/data\/${solr.core.name}<\/dataDir>/g' /ezsolr/server/ez/template/solrconfig.xml
fi

/opt/solr/bin/solr -s /ezsolr/server/ez -f

SOLR_CORES=${SOLR_CORES:-collection1}
CREATE_CORES=false

for core in $SOLR_CORES
do
/opt/solr/bin/solr create_core -c ${core} -d /ezsolr/server/ez/template
echo "Core ${core} created."
done
if [ ! -d /ezsolr/server/ez/${core} ]; then
CREATE_CORES=true
echo "Found missing core: ${core}"
fi
done

if [ "$CREATE_CORES" = true ]; then
echo "Start solr on background to create missing cores"
/opt/solr/bin/solr -s /ezsolr/server/ez

for core in $SOLR_CORES
do
if [ ! -d /ezsolr/server/ez/${core} ]; then
/opt/solr/bin/solr create_core -c ${core} -d /ezsolr/server/ez/template
echo "Core ${core} created."
fi
done
echo "Stop background solr"
/opt/solr/bin/solr stop
fi

/opt/solr/bin/solr -s /ezsolr/server/ez -f

0 comments on commit 1bcf8fd

Please sign in to comment.