Skip to content

Commit dfc8f1c

Browse files
committed
capture aws cp message to check if files were uploaded successfully
1 parent 8c31b5d commit dfc8f1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backfill_corrections/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ publish:
8989
if [[ $$NUM_FILES -gt 0 ]]; then \
9090
aws configure set aws_access_key_id $(AWS_KEY_ID); \
9191
aws configure set aws_secret_access_key $(AWS_SECRET_KEY); \
92-
aws s3 cp $(USR_EXPORT_DIR) $(S3_BUCKET)/ --recursive --exclude "*" --include "*/prediction*.csv.gz"; \
92+
AWS_MSG=`aws s3 cp $(USR_EXPORT_DIR) $(S3_BUCKET)/ --recursive --exclude "*" --include "*/prediction*.csv.gz"`; \
93+
echo "$${AWS_MSG}"; \
94+
[[ `echo "$${AWS_MSG}" | grep "upload:" | wc -l` -eq $$NUM_FILES ]] || ( echo "ERROR: Not all $${NUM_FILES} expected files were uploaded" && exit 74 ); \
9395
echo "SUCCESS: published $${NUM_FILES} files to the S3 bucket" >> $(LOG_FILE); \
9496
else \
9597
echo "No files in $(USR_EXPORT_DIR) to publish" >> $(LOG_FILE); \

0 commit comments

Comments
 (0)