Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions modules/enableit/common/templates/backup/gitea-backup.sh.epp
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,21 @@ abort_stale_multipart_upload() {

# 7. Upload the dump to S3
upload_to_s3() {
local attempt
local attempt aws_config

aws_config=$(mktemp)
cat > "$aws_config" <<EOF
[default]
s3 =
multipart_chunksize = 64MB
multipart_threshold = 64MB
EOF
trap 'rm -f "$aws_config"' RETURN

log "Moving backup to S3..."

for attempt in 1 2 3; do
if aws s3 cp "$LATEST_DUMP" "$S3_BUCKET" \
if AWS_CONFIG_FILE="$aws_config" aws s3 cp "$LATEST_DUMP" "$S3_BUCKET" \
--endpoint-url="$S3_ENDPOINT" \
--cli-read-timeout "$UPLOAD_TIMEOUT" \
--only-show-errors; then
Expand Down