Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions import_digiroad_shapefiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,27 @@ DOWNLOAD_TARGET_FILE="${DOWNLOAD_TARGET_DIR}/${AREA}_R.zip"
# Load zip file containing Digiroad shapefiles if it does not exist.
if [[ ! -f "$DOWNLOAD_TARGET_FILE" ]]; then
mkdir -p "$DOWNLOAD_TARGET_DIR"
curl -Lo "$DOWNLOAD_TARGET_FILE" "$SHP_URL"
COOKIE_JAR="${DOWNLOAD_TARGET_DIR}/curl.cookies"
set +e
output=$(curl -L -c "$COOKIE_JAR" -b "$COOKIE_JAR" -o "$DOWNLOAD_TARGET_FILE" "$SHP_URL" 2>&1)
exit_code=$?

if [[ $exit_code -ne 0 ]]; then
rm $COOKIE_JAR
echo "Error downloading shapefile zip file from $SHP_URL. Curl exit code: $exit_code"
exit $exit_code
fi


DIGIROAD_IRROTUS_NRO=$(curl -sL -c "$COOKIE_JAR" -b "$COOKIE_JAR" "$IRROTUS_NRO_URL" 2>&1)
exit_code=$?
rm $COOKIE_JAR
set -e
if [[ $exit_code -ne 0 ]]; then
echo "Error downloading irrotus_nro file from $IRROTUS_NRO_URL. Curl exit code: $exit_code"
exit $exit_code
fi

DIGIROAD_IRROTUS_NRO=$(curl -sL "$IRROTUS_NRO_URL")
if [[ ! -f "${DOWNLOAD_TARGET_DIR}/digiroad_${DIGIROAD_IRROTUS_NRO}.txt" ]]; then
echo $DIGIROAD_IRROTUS_NRO > "${DOWNLOAD_TARGET_DIR}/digiroad_${DIGIROAD_IRROTUS_NRO}.txt"
fi
Expand Down
6 changes: 3 additions & 3 deletions upload_routing_dump_to_azure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ az account set --subscription "jore4"
if ! time az storage azcopy blob upload \
--source "${SQL_FILE}" \
--recursive \
--account-name "jore4storage" \
--account-name "stjore4dev001" \
--auth-mode "login" \
--container "jore4-digiroad"; then
cat <<EOF

Upload failed. Please make sure that you have installed a version of Azure CLI, which is known to work
(e.g. 2.29.2, may require downgrade).

Alternatively you may perform the upload manually in the azure portal (storage account "jore4storage", container
Alternatively you may perform the upload manually in the azure portal (storage account "stjore4dev001", container
"jore4-digiroad").
EOF
exit 2
Expand All @@ -36,6 +36,6 @@ fi
# List all artifacts inside `jore4-digiroad` in blob storage container.
az storage blob list \
--container-name "jore4-digiroad" \
--account-name "jore4storage" \
--account-name "stjore4dev001" \
--auth-mode "login" \
--query "[].name"
Loading