Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from t-sagara/develop
Merge Develop
- Loading branch information
Showing
13 changed files
with
658 additions
and
476 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
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
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,5 +1,3 @@ | ||
version: "3.9" | ||
|
||
services: | ||
jageocoder-server: | ||
container_name: jageocoder-server | ||
|
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,15 +1,47 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
logfile="/data/init.log" | ||
echo "Checking jageocoder dictionary..." > ${logfile} | ||
|
||
# Search the most recent dictionary file | ||
dicfile=$(ls -t /data/*.zip | head -n1) | ||
|
||
# Check if jageocoder dictionary is installed | ||
if [ ! -e "/opt/db2/address.trie" ]; then | ||
echo "Initialize..." > /data/init.log | ||
echo "Installing dictionary..." >> /data/init.log | ||
jageocoder install-dictionary /data/*.zip >> /data/init.log 2>&1 | ||
do_install=false | ||
triefile="/opt/db2/address.trie" | ||
if [ ! -e "${triefile}" ]; then | ||
echo " No dictionary is installed." >> ${logfile} | ||
do_install=true | ||
elif [ ! -z "${dicfile}" ] && [ "${dicfile}" -nt "${triefile}" ]; then | ||
echo " The dictionary file is newer than the installed dictionary." >> ${logfile} | ||
do_install=true | ||
fi | ||
|
||
if ${do_install} = true; then | ||
if [ -z "${dicfile}" ]; then | ||
echo "[NG] Please place the jageocoder dictionary file in the data directory." >> ${logfile} | ||
exit 1 | ||
fi | ||
|
||
echo " Installing dictionary from '${dicfile}'..." >> ${logfile} | ||
jageocoder install-dictionary -y ${dicfile} >> ${logfile} 2>&1 | ||
if [ $? -ne 0 ]; then | ||
echo "[NG] Dictionary installation failed." >> ${logfile} | ||
exit 1 | ||
fi | ||
|
||
if [ ${BUILD_RTREE} -ne 0 ] ; then | ||
echo "Building R-tree for reverse geocoding..." >> /data/init.log | ||
jageocoder reverse 140.0 35.0 >> /data/init.log 2>&1 | ||
echo " Building R-tree for reverse geocoding..." >> ${logfile} | ||
jageocoder reverse 140.0 35.0 >> ${logfile} 2>&1 | ||
if [ $? -ne 0 ]; then | ||
echo "[NG] R-tree build failed." >> ${logfile} | ||
exit 1 | ||
fi | ||
fi | ||
echo "All done." >> /data/init.log | ||
echo "[OK] The dictionary is installed successfully." >> ${logfile} | ||
else | ||
echo "[OK] The dictionary is already installed." >> ${logfile} | ||
fi | ||
|
||
echo "Starting server process..." >> ${logfile} | ||
python run_waitress.py |
Oops, something went wrong.