Skip to content

Commit b5e54fe

Browse files
authored
Merge pull request #12 from futurice/add-aws-extra-args
Add support for providing extra args for the AWS CLI
2 parents 663abdd + 2a8b5fc commit b5e54fe

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ Variable | Default | Notes
181181
`AWS_ACCESS_KEY_ID` | | Required when using `AWS_S3_BUCKET_NAME`.
182182
`AWS_SECRET_ACCESS_KEY` | | Required when using `AWS_S3_BUCKET_NAME`.
183183
`AWS_DEFAULT_REGION` | | Optional when using `AWS_S3_BUCKET_NAME`. Allows you to override the AWS CLI default region. Usually not needed.
184+
`AWS_EXTRA_ARGS` | | Optional additional args for the AWS CLI. Useful for e.g. providing `--endpoint-url <url>` for S3-interopable systems, such as DigitalOcean Storage.
184185
`INFLUXDB_URL` | | When provided, backup metrics will be sent to an InfluxDB instance at this URL, e.g. `https://influxdb.example.com`.
185186
`INFLUXDB_DB` | | Required when using `INFLUXDB_URL`; e.g. `my_database`.
186187
`INFLUXDB_CREDENTIALS` | | Required when using `INFLUXDB_URL`; e.g. `user:pass`.

src/backup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ if [ ! -z "$AWS_S3_BUCKET_NAME" ]; then
8080
info "Uploading backup to S3"
8181
echo "Will upload to bucket \"$AWS_S3_BUCKET_NAME\""
8282
TIME_UPLOAD="$(date +%s.%N)"
83-
aws s3 cp --only-show-errors "$BACKUP_FILENAME" "s3://$AWS_S3_BUCKET_NAME/"
83+
aws $AWS_EXTRA_ARGS s3 cp --only-show-errors "$BACKUP_FILENAME" "s3://$AWS_S3_BUCKET_NAME/"
8484
echo "Upload finished"
8585
TIME_UPLOADED="$(date +%s.%N)"
8686
fi

src/entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ cat <<EOF > env.sh
88
BACKUP_SOURCES="${BACKUP_SOURCES:-/backup}"
99
BACKUP_CRON_EXPRESSION="${BACKUP_CRON_EXPRESSION:-@daily}"
1010
AWS_S3_BUCKET_NAME="${AWS_S3_BUCKET_NAME:-}"
11+
AWS_EXTRA_ARGS="${AWS_EXTRA_ARGS:-}"
1112
BACKUP_FILENAME=${BACKUP_FILENAME:-"backup-%Y-%m-%dT%H-%M-%S.tar.gz"}
1213
BACKUP_ARCHIVE="${BACKUP_ARCHIVE:-/archive}"
1314
BACKUP_WAIT_SECONDS="${BACKUP_WAIT_SECONDS:-0}"

0 commit comments

Comments
 (0)