Skip to content
Snippets Groups Projects
Commit 01b9e01a authored by User expired's avatar User expired
Browse files

fixed open task (downloading without error checking for spatialite DB

parent 2013a946
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -125,8 +125,10 @@ function fn_download() { ...@@ -125,8 +125,10 @@ function fn_download() {
local FILE="${1}" local FILE="${1}"
local URL="${2}" local URL="${2}"
local ARGS="${3} --continue --no-check-certificate --quiet" local ARGS="${3} --continue --no-check-certificate --quiet"
# TODO: Stopped here!! local FAIL_ON_ERROR="${4}"
local CHECK_STATUS="${4}" if [ -z "$FAIL_ON_ERROR" ]; then
FAIL_ON_ERROR=true
fi
fn_echo " - downloading ${FILE}" "DEBUG" fn_echo " - downloading ${FILE}" "DEBUG"
fn_echo " - from URL: ${URL}" "DEBUG" fn_echo " - from URL: ${URL}" "DEBUG"
...@@ -136,18 +138,28 @@ function fn_download() { ...@@ -136,18 +138,28 @@ function fn_download() {
# fn_check_status " - download canceled, since nothing was found at URL \"${URL}\"" # fn_check_status " - download canceled, since nothing was found at URL \"${URL}\""
${EXEC_WGET} ${ARGS} --output-document="${FILE}" "${URL}" ${EXEC_WGET} ${ARGS} --output-document="${FILE}" "${URL}"
fn_check_status " - download failed for URL \"${URL}\"" if $FAIL_ON_ERROR; then
fn_check_status " - download failed for URL \"${URL}\""
fi
return $? return $?
} }
function fn_download_newer() { function fn_download_newer() {
local FILE="${1}"
local URL="${2}"
local ARGS="${3} --timestamping"
local FAIL_ON_ERROR="${4}"
if [ -z "$FAIL_ON_ERROR" ]; then
FAIL_ON_ERROR=true
fi
if [ -f "${1}" ]; then if [ -f "${1}" ]; then
fn_echo " - not downloading ${1}, since it already exists" "DEBUG" fn_echo " - not downloading ${1}, since it already exists" "DEBUG"
return 0 return 0
fi fi
fn_download "${1}" "${2}" "${3} --timestamping" fn_download "${FILE}" "${URL}" "${ARGS}" "${FAIL_ON_ERROR}"
return $? return $?
} }
......
...@@ -186,7 +186,7 @@ function fn_import_spatialite() { ...@@ -186,7 +186,7 @@ function fn_import_spatialite() {
SPATIALITE_FILENAME="isochrone_${SRID}.spatialite" SPATIALITE_FILENAME="isochrone_${SRID}.spatialite"
if ! $UPDATE_DATA; then if ! $UPDATE_DATA; then
fn_echo "Importing spatialite database" fn_echo "Importing spatialite database"
fn_download_newer $DOWNLOAD_DIR/$SPATIALITE_FILENAME "${CACHE_DIR_REMOTE}${SPATIALITE_FILENAME}" fn_download_newer "$DOWNLOAD_DIR/$SPATIALITE_FILENAME" "${CACHE_DIR_REMOTE}${SPATIALITE_FILENAME}" "" false
cp -f "$DOWNLOAD_DIR/$SPATIALITE_FILENAME" "$DATA_DIR/" cp -f "$DOWNLOAD_DIR/$SPATIALITE_FILENAME" "$DATA_DIR/"
fi fi
...@@ -204,8 +204,10 @@ function fn_import_spatialite() { ...@@ -204,8 +204,10 @@ function fn_import_spatialite() {
fn_echo " - setting spatialite database permissions" fn_echo " - setting spatialite database permissions"
chown -R apache:apache "$DATA_DIR/$SPATIALITE_FILENAME" chown -R apache:apache "$DATA_DIR/$SPATIALITE_FILENAME"
chmod -R -g+rwX "$DATA_DIR/$SPATIALITE_FILENAME" chmod -R -g+rwX "$DATA_DIR/$SPATIALITE_FILENAME"
return 0
else else
fn_echo " - spatialite database could not be created!" >&2 return 1
fi fi
} }
...@@ -245,6 +247,7 @@ if $DEPLOY_ANY_DATASET; then ...@@ -245,6 +247,7 @@ if $DEPLOY_ANY_DATASET; then
# Not importing datasets one-by-one into spatialite -> we copy data from postgis (after postgis data import) # Not importing datasets one-by-one into spatialite -> we copy data from postgis (after postgis data import)
if $IMPORT_DATA_SPATIALITE; then if $IMPORT_DATA_SPATIALITE; then
fn_import_spatialite "$CURRENT_SRID" fn_import_spatialite "$CURRENT_SRID"
fn_check_status "Spatialite database could not be created!"
fi fi
done done
......
...@@ -779,10 +779,11 @@ if $INSTALL_GEOSERVER; then ...@@ -779,10 +779,11 @@ if $INSTALL_GEOSERVER; then
fi fi
if $INSTALL_SPATIALITE_ADMIN; then if $INSTALL_SPATIALITE_ADMIN; then
# TODO: Check this (does not seem to work)
# TODO: What to do if there are multiple target_srid entries defined? # TODO: What to do if there are multiple target_srid entries defined?
fn_echo "Configuring phpLiteAdmin" fn_echo "Configuring phpLiteAdmin"
cp $DEPLOY_DIR/phpliteadmin/phpliteadmin.config.sample.php $DEPLOY_DIR/phpliteadmin/phpliteadmin.config.php cp $DEPLOY_DIR/phpliteadmin/phpliteadmin.config.sample.php $DEPLOY_DIR/phpliteadmin/phpliteadmin.config.php
# TODO: Check this (does not seem to work)
sed -i "s/password = 'admin'/password = '${TOMCAT_PASSWORD}'/" $DEPLOY_DIR/phpliteadmin/phpliteadmin.config.php sed -i "s/password = 'admin'/password = '${TOMCAT_PASSWORD}'/" $DEPLOY_DIR/phpliteadmin/phpliteadmin.config.php
sed -i "s/directory = '\.'/directory = false/" $DEPLOY_DIR/phpliteadmin/phpliteadmin.config.php sed -i "s/directory = '\.'/directory = false/" $DEPLOY_DIR/phpliteadmin/phpliteadmin.config.php
sed -i "s/subdirectories = false/subdirectories = true/" $DEPLOY_DIR/phpliteadmin/phpliteadmin.config.php sed -i "s/subdirectories = false/subdirectories = true/" $DEPLOY_DIR/phpliteadmin/phpliteadmin.config.php
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment