From 24469d6105eb84b8da1a2e4d17ee77f10bbe3bdd Mon Sep 17 00:00:00 2001 From: devthejo Date: Fri, 28 Jun 2024 20:26:05 +0200 Subject: [PATCH] feat: minio-upload multi target --- minio-upload/entrypoint.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/minio-upload/entrypoint.sh b/minio-upload/entrypoint.sh index 1406bbd..a4f9155 100755 --- a/minio-upload/entrypoint.sh +++ b/minio-upload/entrypoint.sh @@ -35,13 +35,15 @@ secret_key=$3 local_path=$4 remote_path=$5 -info "Will upload $local_path to $remote_path" - mc alias set s3 $url $access_key $secret_key ok_or_die "Could not set mc alias" -mc cp -r $local_path s3/$remote_path -ok_or_die "Could not upload object" +IFS=' ' read -r -a remote_paths <<< "$remote_path" +for rpath in "${remote_paths[@]}"; do + info "Will upload $local_path to $rpath" + mc cp -r "$local_path" "$rpath" + ok_or_die "Could not upload object" +done if [[ $# -eq 6 ]] ; then if [[ $6 -eq 1 ]] ; then