Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add country codes maps to the data dictionaries #2559 #2711

Merged
merged 2 commits into from
May 31, 2022
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
2 changes: 1 addition & 1 deletion data-serving/scripts/export-data/Dockerfile_full_export
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.14
RUN apk update
RUN apk add bash aws-cli
RUN apk add bash aws-cli curl

COPY common.sh .
COPY full_export.sh .
Expand Down
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curl needs to be added to the Dockerfile_full_export as well


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