@@ -33,20 +33,26 @@ case "$1" in
3333 SPATIAL_URL_ESCAPED=$( printf ' %s\n' " $SPATIAL_URL " | sed -e ' s/[\/&]/\\&/g' )
3434 sed -i " s/https\:\/\/spatial\.ala\.org\.au/$SPATIAL_URL_ESCAPED /" " $CONF "
3535
36- echo " Downloading SDS configs..."
36+ echo " Downloading SDS configs..." >&2
3737 for DEST in sensitive-species-data.xml sensitivity-zones.xml sensitivity-categories.xml
3838 do
39- curl -sL -o " /data/sds/$DEST " " $SDS_URL /$DEST "
39+ curl -sL -o " /data/sds/$DEST " " $SDS_URL /$DEST " || echo " Warning: Failed to download $SDS_URL / $DEST "
4040 done
41- curl -sf -o /data/sds/layers.json -L " $SDS_URL /ws/layers"
4241
43- echo " Downloading SDS layers... "
44- curl -sf -o /data/biocache /layers/sds-layers.tgz -L $LAYERS_URL
42+ echo " Downloading SDS layers.json... " >&2
43+ curl -sf -o /data/sds /layers.json -L " $SDS_URL /ws/layers " || echo " Warning: Failed to download layers.json "
4544
46- echo " Extracting SDS layers..."
47- # SDS def ALA tgz is created with a MacOS tar
48- # https://github.com/yarnpkg/yarn/issues/770
49- tar --no-same-owner --warning=no-unknown-keyword -zxf /data/biocache/layers/sds-layers.tgz -C /data/biocache/layers/
45+ echo " Downloading SDS layers.tgz..." >&2
46+ curl -sf -o /data/biocache/layers/sds-layers.tgz -L " $LAYERS_URL " || echo " Warning: Failed to download SDS layers tgz"
47+
48+ if [ -f /data/biocache/layers/sds-layers.tgz ]; then
49+ echo " Extracting SDS layers.tgz..." >&2
50+ # SDS def ALA tgz is created with a MacOS tar
51+ # https://github.com/yarnpkg/yarn/issues/770
52+ tar --no-same-owner --warning=no-unknown-keyword -zxf /data/biocache/layers/sds-layers.tgz -C /data/biocache/layers/
53+ else
54+ echo " Warning: SDS layers tgz not found, skipping extraction"
55+ fi
5056
5157 chown -R sds-data:sds-data /opt/atlas/ala-sensitive-data-service
5258
@@ -58,4 +64,4 @@ case "$1" in
5864 ;;
5965esac
6066
61- echo ala-sensitive-data-service installed
67+ echo ala-sensitive-data-service installed >&2
0 commit comments