git: initial commit
This commit is contained in:
commit
67c0137d4e
2 changed files with 32 additions and 0 deletions
7
Dockerfile
Normal file
7
Dockerfile
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
FROM alpine:3
|
||||||
|
|
||||||
|
RUN apk add --no-cache aws-cli
|
||||||
|
|
||||||
|
ADD src /app
|
||||||
|
|
||||||
|
CMD ["/app/run"]
|
25
src/run
Executable file
25
src/run
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
aws_options="$PLUGIN_AWS_OPTIONS"
|
||||||
|
options="$PLUGIN_OPTIONS"
|
||||||
|
src="$PLUGIN_SOURCE"
|
||||||
|
dest="$PLUGIN_TARGET"
|
||||||
|
|
||||||
|
endpoint="$PLUGIN_ENDPOINT"
|
||||||
|
|
||||||
|
export AWS_ACCESS_KEY_ID="$PLUGIN_ACCESS_KEY"
|
||||||
|
export AWS_SECRET_ACCESS_KEY="$PLUGIN_SECRET_KEY"
|
||||||
|
|
||||||
|
export AWS_DEFAULT_REGION="$PLUGIN_REGION"
|
||||||
|
|
||||||
|
[ -z "$src" ] || [ -z "$dest" ] && {
|
||||||
|
echo "Source and destination are required."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
[ -n "$endpoint" ] && aws_options="--endpoint-url $endpoint $aws_options"
|
||||||
|
|
||||||
|
echo "Syncing from S3..."
|
||||||
|
exec aws $aws_options s3 sync "$src" "$dest" $options
|
Loading…
Reference in a new issue