From bc9e89cf79299ae52c12c0bc7fa03d3e89532d90 Mon Sep 17 00:00:00 2001 From: George Taylor Date: Wed, 9 Oct 2024 12:59:58 +0100 Subject: [PATCH] Update migrate-s3.yaml --- .github/workflows/migrate-s3.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/migrate-s3.yaml b/.github/workflows/migrate-s3.yaml index c4952ee..bba2afc 100644 --- a/.github/workflows/migrate-s3.yaml +++ b/.github/workflows/migrate-s3.yaml @@ -63,12 +63,12 @@ jobs: SRC_BUCKET="${{ vars.MIGRATION_SRC_BUCKET }}" - DIRS=$(kubectl exec $SERVICE_POD_NAME -- aws s3 ls $SRC_BUCKET | grep -v contentstore | awk '/\/$/ && NF {print $2}' | tr -d '/' | tr '\n' ',' | sed 's/,$/\n/') - - prefixes=$(kubectl exec $SERVICE_POD_NAME -- aws s3api list-objects-v2 --bucket $SRC_BUCKET --delimiter '/' --query 'CommonPrefixes[*].Prefix' --output text) + prefixes=$(kubectl exec $SERVICE_POD_NAME -- aws s3api list-objects-v2 --bucket $SRC_BUCKET --delimiter '/' --query 'CommonPrefixes[*].Prefix' --output text) + # remove all spaces and put one comma between prefixes + cleaned_prefixes=$(echo $prefixes | tr ' ' ',') DIRS="" IFS=' ' - for prefix in $prefixes; do + 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) #append to DIRS comma separated if [ -n "$DIR" ]; then