s3-resource-simple/script/run

24 lines
397 B
Text
Raw Normal View History

#!/bin/sh
set -e
source=$1
2016-03-10 09:57:41 +01:00
bucket=$2
2016-03-10 09:57:41 +01:00
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 .
2016-03-10 09:57:41 +01:00
json="{\"source\": {\"bucket\": \"$bucket\"}}"
echo $json | docker run \
--env-file .env \
2016-03-10 09:57:41 +01:00
-i \
--rm \
-v $source:/tmp/input \
18fgsa/s3-resource-simple \
/opt/resource/out /tmp/input