Skip to content

Commit

Permalink
Add instructions on how to rerun a failed coding system import
Browse files Browse the repository at this point in the history
  • Loading branch information
rebkwok committed Oct 31, 2023
1 parent 7ab8785 commit 83295e7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions deploy/bin/import_latest_release.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ set -euo pipefail
# on dokku3 and run using the cronfile at opencodelists/deploy/bin/import_latest_dmd_cron
# SLACK_WEBHOOK_URL and SLACK_DATATEAM_WEBHOOK_URL is an environment variable set in the cronfile on dokku3


CODING_SYSTEM=$1

REPO_ROOT="/app"
Expand Down Expand Up @@ -70,7 +69,16 @@ function post_failure_message_and_cleanup() {
# restart app
/usr/bin/dokku ps:restart opencodelists
# Report and notify data team in slack
failure_message_text="Latest ${CODING_SYSTEM} release failed to import to OpenCodelists.\nCheck logs on dokku3 at ${LOG_FILE}"
failure_message_text="\
Latest ${CODING_SYSTEM} release failed to import to OpenCodelists.\n \
Check logs on dokku3 at ${LOG_FILE}\n \
If you need to rerun the import, find the release name and valid from date (check the start of the log file) and run: \
\`\`\`dokku run opencodelists \
python $REPO_ROOT/manage.py \
import_coding_system_data ${CODING_SYSTEM} ${DOWNLOAD_DIR} \
--release <release name> \
--valid-from <YYYY-MM-DD> \
--force && dokku ps:restart opencodelists\`\`\`"
post_to_slack "${failure_message_text}" "${SLACK_DATATEAM_WEBHOOK_URL}"
}

Expand Down

0 comments on commit 83295e7

Please sign in to comment.