Skip to content

Commit

Permalink
🐝 Add preflight check for "make sync-images"
Browse files Browse the repository at this point in the history
It now checks if you have installed the AWS CLI, and whether you have
configured it, before letting you proceed.
  • Loading branch information
larsyencken committed Dec 1, 2023
1 parent b301507 commit c002b2f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ migrate:
@echo '==> Running DB migrations'
yarn && yarn buildTsc && yarn runDbMigrations

refresh.full: refresh refresh.wp sync-images

refresh:
@echo '==> Downloading chart data'
./devTools/docker/download-grapher-metadata-mysql.sh
Expand All @@ -153,11 +155,16 @@ refresh.wp:
@echo '[email protected] user to the value from `.env:WORDPRESS_API_PASS`'
@echo 'at https://staging.owid.cloud/wp/wp-admin/user-edit.php?user_id=35'

sync-images:
sync-images: sync-images.preflight-check
@echo '==> Syncing S3 images'
@. ./.env && ./devTools/docker/sync-s3-images.sh

refresh.full: refresh refresh.wp sync-images
sync-images.preflight-check:
@echo '==> Checking for aws cli'
@which aws >/dev/null 2>&1 || (echo "ERROR: please install aws cli -- e.g. brew install awscli"; exit 1)
@echo '==> Checking if aws cli is configured'
@test -f ~/.aws/config || (echo "ERROR: please configure aws cli -- e.g. aws configure"; exit 1)


down:
@echo '==> Stopping services'
Expand Down

0 comments on commit c002b2f

Please sign in to comment.