Skip to content

Commit f2d8e5b

Browse files
committed
Update storage account used in upload script
1 parent be7928f commit f2d8e5b

2 files changed

Lines changed: 23 additions & 5 deletions

File tree

import_digiroad_shapefiles.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,27 @@ DOWNLOAD_TARGET_FILE="${DOWNLOAD_TARGET_DIR}/${AREA}_R.zip"
1717
# Load zip file containing Digiroad shapefiles if it does not exist.
1818
if [[ ! -f "$DOWNLOAD_TARGET_FILE" ]]; then
1919
mkdir -p "$DOWNLOAD_TARGET_DIR"
20-
curl -Lo "$DOWNLOAD_TARGET_FILE" "$SHP_URL"
20+
COOKIE_JAR="${DOWNLOAD_TARGET_DIR}/curl.cookies"
21+
set +e
22+
output=$(curl -L -c "$COOKIE_JAR" -b "$COOKIE_JAR" -o "$DOWNLOAD_TARGET_FILE" "$SHP_URL" 2>&1)
23+
exit_code=$?
24+
25+
if [[ $exit_code -ne 0 ]]; then
26+
rm $COOKIE_JAR
27+
echo "Error downloading shapefile zip file from $SHP_URL. Curl exit code: $exit_code"
28+
exit $exit_code
29+
fi
30+
31+
32+
DIGIROAD_IRROTUS_NRO=$(curl -sL -c "$COOKIE_JAR" -b "$COOKIE_JAR" "$IRROTUS_NRO_URL" 2>&1)
33+
exit_code=$?
34+
rm $COOKIE_JAR
35+
set -e
36+
if [[ $exit_code -ne 0 ]]; then
37+
echo "Error downloading irrotus_nro file from $IRROTUS_NRO_URL. Curl exit code: $exit_code"
38+
exit $exit_code
39+
fi
2140

22-
DIGIROAD_IRROTUS_NRO=$(curl -sL "$IRROTUS_NRO_URL")
2341
if [[ ! -f "${DOWNLOAD_TARGET_DIR}/digiroad_${DIGIROAD_IRROTUS_NRO}.txt" ]]; then
2442
echo $DIGIROAD_IRROTUS_NRO > "${DOWNLOAD_TARGET_DIR}/digiroad_${DIGIROAD_IRROTUS_NRO}.txt"
2543
fi

upload_routing_dump_to_azure.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ az account set --subscription "jore4"
1919
if ! time az storage azcopy blob upload \
2020
--source "${SQL_FILE}" \
2121
--recursive \
22-
--account-name "jore4storage" \
22+
--account-name "stjore4dev001" \
2323
--auth-mode "login" \
2424
--container "jore4-digiroad"; then
2525
cat <<EOF
2626
2727
Upload failed. Please make sure that you have installed a version of Azure CLI, which is known to work
2828
(e.g. 2.29.2, may require downgrade).
2929
30-
Alternatively you may perform the upload manually in the azure portal (storage account "jore4storage", container
30+
Alternatively you may perform the upload manually in the azure portal (storage account "stjore4dev001", container
3131
"jore4-digiroad").
3232
EOF
3333
exit 2
@@ -36,6 +36,6 @@ fi
3636
# List all artifacts inside `jore4-digiroad` in blob storage container.
3737
az storage blob list \
3838
--container-name "jore4-digiroad" \
39-
--account-name "jore4storage" \
39+
--account-name "stjore4dev001" \
4040
--auth-mode "login" \
4141
--query "[].name"

0 commit comments

Comments
 (0)