diff --git a/stdlib/aws/aws.cue b/stdlib/aws/aws.cue index 79c3b64f..975454cb 100644 --- a/stdlib/aws/aws.cue +++ b/stdlib/aws/aws.cue @@ -56,6 +56,9 @@ import ( // Always execute the script? always?: bool + // Directory + dir?: dagger.#Artifact + out: { string @@ -101,6 +104,9 @@ import ( AWS_PAGER: "" } mount: "/cache/aws": "cache" + if dir != _|_ { + mount: "/inputs/source": from: dir + } }, op.#Export & { source: export diff --git a/stdlib/aws/s3/s3.cue b/stdlib/aws/s3/s3.cue index 5c1ef05e..679d2c63 100644 --- a/stdlib/aws/s3/s3.cue +++ b/stdlib/aws/s3/s3.cue @@ -42,20 +42,21 @@ import ( code: #""" opts="" + op=cp if [ -d /inputs/source ]; then - opts="--recursive" + op=sync fi if [ -f /inputs/content_type ]; then opts="--content-type $(cat /inputs/content_type)" fi - aws s3 cp $opts /inputs/source "$(cat /inputs/target)" + aws s3 $op $opts /inputs/source "$(cat /inputs/target)" cat /inputs/target \ | sed -E 's=^s3://([^/]*)/=https://\1.s3.amazonaws.com/=' \ > /url """# if sourceInline == _|_ { - mount: "/inputs/source": from: source + dir: source } } }