23 lines
397 B
Bash
Executable file
23 lines
397 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
source=$1
|
|
bucket=$2
|
|
|
|
if [ -z "$source" ] || [ -z "$bucket" ]; then
|
|
echo "usage: $0 </full/path/to/dir/or/file> <bucket>"
|
|
exit 1
|
|
fi
|
|
|
|
docker build -t 18fgsa/s3-resource-simple .
|
|
|
|
json="{\"source\": {\"bucket\": \"$bucket\"}}"
|
|
|
|
echo $json | docker run \
|
|
--env-file .env \
|
|
-i \
|
|
--rm \
|
|
-v $source:/tmp/input \
|
|
18fgsa/s3-resource-simple \
|
|
/opt/resource/out /tmp/input
|