Skip to content

Commit

Permalink
Update migrate-s3.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
georgepstaylor committed Nov 18, 2024
1 parent 93b68a7 commit ba15979
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/migrate-s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ jobs:
# remove all spaces and put one comma between prefixes
cleaned_prefixes=$(echo $prefixes | tr -s '[:space:]' ',' | sed 's/[,/]*$//')
# remove `contentstore.deleted/` from cleaned_prefixes
cleaned_prefixes=$(echo $cleaned_prefixes | sed 's/contentstore.deleted,//')
# remove `contentstore.deleted/` from cleaned_prefixes with comma if in list
cleaned_prefixes=$(echo $cleaned_prefixes | sed 's/contentstore.deleted,//')\
# remove `contentstore.deleted` from cleaned_prefixes if at the end of the list
cleaned_prefixes=$(echo $cleaned_prefixes | sed 's/contentstore.deleted//')
DIRS=""
IFS=','
for prefix in $cleaned_prefixes; do
DIR=$(kubectl exec $SERVICE_POD_NAME -- aws s3api list-objects-v2 --bucket $SRC_BUCKET --prefix "$prefix" --delimiter '/' --query 'CommonPrefixes[*].Prefix' --output text)
if [ -n "$DIR" ]; then
DIR=$(echo $DIR | tr -s '[:space:]' ',' | sed 's/[,/]*$//')
Expand Down

0 comments on commit ba15979

Please sign in to comment.