Skip to content

Commit

Permalink
change file rights for execution
Browse files Browse the repository at this point in the history
  • Loading branch information
Perrine Letellier committed Aug 27, 2024
1 parent 4e08495 commit b7e0d81
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions clevercloud/run_succeeded_hook.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
curl $S3CFG_FILE_URI > .s3cfg
#!/bin/bash
curl $S3CFG_FILE_URI > ~/.s3cfg
# retrieve most recent date
FILEPATH=$(s3cmd ls s3://csv-data| tail -1 | awk '{ print $2 }')
DATE=${FILEPATH##"s3://csv-data/"}
DATE=${DATE%"/"}
mkdir csv-data
# if this date doesn't exist yet
if ls csv-data/$DATE ; then
echo "This data has already been loaded"
else
# retrieve most recent files
mkdir -p csv-data/$DATE/
mkdir csv-data/$DATE/
s3cmd get s3://csv-data/$DATE/ --recursive csv-data/$DATE/
# import those files to database (django models)
python $APP_ID/manage.py load_ingredients -d csv-data/$DATE $DATE
Expand Down

0 comments on commit b7e0d81

Please sign in to comment.