Skip to content

Commit

Permalink
Add country codes maps to the data dictionaries #2559
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleeg committed May 31, 2022
1 parent b8c4142 commit 35b5482
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data-serving/scripts/export-data/full_export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ set -xeuo pipefail
source ./common.sh
require_env "${COUNTRY_EXPORT_BUCKET:-}" "Specify COUNTRY_EXPORT_BUCKET"
require_env "${FULL_EXPORT_BUCKET:-}" "Specify FULL_EXPORT_BUCKET"
require_env "${GDOTH_API_BASEURL:-}" "Specify GDOTH_API_BASEURL"
require_env "${GDOTH_API_KEY:-}" "Specify GDOTH_API_KEY"

# https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-retries.html#cli-usage-retries-configure
export AWS_MAX_ATTEMPTS=10
Expand All @@ -26,6 +28,9 @@ trap 'rm -rf "$DIR"' EXIT # Cleanup before exit

cp data_dictionary.txt citation.txt "$DIR"

echo "Getting country list from ${GDOTH_API_BASEURL}..."
curl -H "X-API-Key: ${GDOTH_API_KEY}" "${GDOTH_API_BASEURL}/api/geocode/countryNames" > "${DIR}/countries.json"

mkdir "${DIR}/country"
echo "Downloading files from ${COUNTRY_EXPORT_BUCKET}..."
aws s3 sync "${COUNTRY_EXPORT_BUCKET}/${FORMAT}/" "${DIR}/country"
Expand Down

0 comments on commit 35b5482

Please sign in to comment.