Skip to content

Commit

Permalink
Allow more config files for solr (dokku#9).
Browse files Browse the repository at this point in the history
  • Loading branch information
arturolinares committed Aug 26, 2019
1 parent 51ee37f commit 9e1e58b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ OR
- Change SOLR_DATABASE_SCHEME to the desired setting
- Relink the service

## Core settings

You can configure the solr core adding files to `/solr` directory in your application. Fore example, files like `protwords.txt`, `solrconfig.xml` and other schema extra files.

## Disabling `docker pull` calls

If you wish to disable the `docker pull` calls that the plugin triggers, you may set the `SOLR_DISABLE_PULL` environment variable to `true`. Once disabled, you will need to pull the service image you wish to deploy as shown in the `stderr` output.
Expand Down
21 changes: 5 additions & 16 deletions post-extract
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,14 @@ solr-post-extract() {
return
fi

if [[ -f "${TMPDIR}/solr/schema.xml" ]]; then
if [[ -d "${TMPDIR}/solr" ]]; then
for SERVICE in $LINKED_SERVICES; do
dokku_log_info1_quiet "Copying solr/schema.xml to service conf/schema.xml"
dokku_log_info1_quiet "Copying solr to service conf"
SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}"
SERVICE_CONTAINER_ID="$(cat "$SERVICE_ROOT/ID")"
docker cp "${TMPDIR}/solr/schema.xml" "${SERVICE_CONTAINER_ID}:/opt/solr/server/solr/mycores/${SERVICE}/conf/schema.xml"
sudo /bin/chown 8983 "${SERVICE_ROOT}/data/${SERVICE}/conf/schema.xml"
sudo /bin/chgrp 8983 "${SERVICE_ROOT}/data/${SERVICE}/conf/schema.xml"
done
fi

if [[ -f "${TMPDIR}/solr/solrconfig.xml" ]]; then
for SERVICE in $LINKED_SERVICES; do
dokku_log_info1_quiet "Copying solr/solrconfig.xml to service' conf/solrconfig.xml"
SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}"
SERVICE_CONTAINER_ID="$(cat "$SERVICE_ROOT/ID")"
docker cp "${TMPDIR}/solr/solrconfig.xml" "${SERVICE_CONTAINER_ID}:/opt/solr/server/solr/mycores/${SERVICE}/conf/solrconfig.xml"
sudo /bin/chown 8983 "${SERVICE_ROOT}/data/${SERVICE}/conf/solrconfig.xml"
sudo /bin/chgrp 8983 "${SERVICE_ROOT}/data/${SERVICE}/conf/solrconfig.xml"
for f in ${TMPDIR}/solr/*; do docker cp $f "${SERVICE_CONTAINER_ID}:/opt/solr/server/solr/mycores/${SERVICE}/conf/"; done
sudo /bin/chown 8983 "${SERVICE_ROOT}/data/${SERVICE}/conf/"*
sudo /bin/chgrp 8983 "${SERVICE_ROOT}/data/${SERVICE}/conf/"*
done
fi
}
Expand Down

0 comments on commit 9e1e58b

Please sign in to comment.