-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
#!/bin/sh | ||
|
||
if ! grep -q "host.docker.internal" /etc/hosts; then | ||
echo "host.docker.internal has to be in your hosts-file, to add you need sudo privileges" | ||
sudo sh -c 'echo "127.0.0.1 host.docker.internal" >> /etc/hosts' | ||
UPDATE_HOSTS=${HAS_SUDO:-true} | ||
|
||
if [ "$UPDATE_HOSTS" = "true" ] && ! grep -q "search.uitdatabank.local" /etc/hosts; then | ||
echo "search.uitdatabank.local has to be in your hosts-file, to add you need sudo privileges" | ||
sudo sh -c 'echo "127.0.0.1 search.uitdatabank.local" >> /etc/hosts' | ||
fi | ||
|
||
DIR="../appconfig/files/uitdatabank/docker/udb3-search-service/" | ||
APPCONFIG_ROOTDIR=${APPCONFIG:-'../appconfig'} | ||
GEOJSON_DATA_ROOTDIR=${GEOJSON_DATA:-'../geojson-data'} | ||
|
||
DIR="${APPCONFIG_ROOTDIR}/files/uitdatabank/docker/udb3-search-service/" | ||
if [ -d "$DIR" ]; then | ||
cp -R "$DIR"/* . | ||
else | ||
echo "Error: missing appconfig. The appconfig and udb3-search-service repositories must be cloned into the same parent folder." | ||
echo "Error: missing appconfig. The appconfig repository must be cloned at ${APPCONFIG_ROOTDIR}." | ||
exit 1 | ||
fi | ||
|
||
DIR="../appconfig/files/uitdatabank/docker/keys/" | ||
DIR="${APPCONFIG_ROOTDIR}/files/uitdatabank/docker/keys/" | ||
if [ -d "$DIR" ]; then | ||
cp -R "$DIR"/* . | ||
else | ||
echo "Error: missing appconfig. The appconfig and udb3-search-service repositories must be cloned into the same parent folder." | ||
echo "Error: missing appconfig. The appconfig repository must be cloned at ${APPCONFIG_ROOTDIR}." | ||
exit 1 | ||
fi | ||
|
||
DIR="../geojson-data/output" | ||
DIR="${GEOJSON_DATA_ROOTDIR}/output" | ||
if [ -d "$DIR" ]; then | ||
cp "$DIR"/facet_mapping_regions.yml . | ||
else | ||
echo "Error: missing geojson data. See docker.md prerequisites to fix this." | ||
echo "Error: missing geojson-data. The geojson-data repository must be cloned at ${GEOJSON_DATA_ROOTDIR}." | ||
exit 1 | ||
fi | ||
fi |