git: initial commit

This commit is contained in:
Ax333l 2022-08-22 15:52:07 +02:00
commit 67c0137d4e
Signed by: Ax333l
GPG key ID: D2B4D85271127D23
2 changed files with 32 additions and 0 deletions

7
Dockerfile Normal file
View 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
View 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