Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Qepm 1117 test artifacts integrate artifact storing flow into importa…
Browse files Browse the repository at this point in the history
…nt reusable workflows (#4)

Added if condition when input flags are not set

Improved debugging

Removed string literals from path

Changed commit hash back to latest master

Support spaces in source parameter
  • Loading branch information
krikkrob authored Nov 20, 2023
1 parent 01c8dec commit 995620e
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,27 @@ main() {
aws --version

# Iterate over $INPUT_SOURCE multiline string and run aws s3 $COMMAND
while IFS= read -r source; do
while IFS= read -r source; do
if [ -n "$source" ]; then
if [ "$COMMAND" == "cp" ] || [ "$COMMAND" == "mv" ] || [ "$COMMAND" == "sync" ]
then
echo "aws s3 $COMMAND \"$source\" $INPUT_DESTINATION $INPUT_FLAGS"
aws s3 "$COMMAND" "$source" "$INPUT_DESTINATION" "$INPUT_FLAGS"
if [ "$COMMAND" == "cp" ] || [ "$COMMAND" == "mv" ] || [ "$COMMAND" == "sync" ]; then
if [ -n "$INPUT_FLAGS" ]; then
cmd="aws s3 $COMMAND \"$source\" $INPUT_DESTINATION $INPUT_FLAGS"
echo "Executing command: $cmd"
$cmd
else
cmd="aws s3 $COMMAND \"$source\" $INPUT_DESTINATION"
echo "Executing command: $cmd"
$cmd
fi
else
echo "aws s3 $COMMAND \"$source\" $INPUT_FLAGS"
aws s3 "$COMMAND" "$source" "$INPUT_FLAGS"
cmd="aws s3 $COMMAND \"$source\" $INPUT_FLAGS"
echo "Executing command: $cmd"
$cmd
fi
else
echo "Source is empty, skipping AWS S3 command."
fi
done <<< "$INPUT_SOURCE"
done <<< "$INPUT_SOURCE"
}

main

0 comments on commit 995620e

Please sign in to comment.