Skip to content

Commit

Permalink
Remove multipart configs if AWS_BACKUP_MULTIPART_CHUNK_SIZE is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
drubin committed Dec 26, 2017
1 parent a3a23a4 commit 75e60b6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion assets/runtime/config/gitlabhq/gitlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,11 @@ production: &base
aws_secret_access_key: '{{AWS_BACKUP_SECRET_ACCESS_KEY}}'
# The remote 'directory' to store your backups. For S3, this would be the bucket name.
remote_directory: '{{AWS_BACKUP_BUCKET}}'
#start-aws-multipart
# Use multipart uploads when file size reaches 100MB, see
# http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html
# http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html
multipart_chunk_size: {{AWS_BACKUP_MULTIPART_CHUNK_SIZE}}
#end-aws-multipart
# # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional
# # encryption: 'AES256'
# Fog storage connection settings, see http://fog.io/storage/ .
Expand Down
2 changes: 1 addition & 1 deletion assets/runtime/env-defaults
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ AWS_BACKUP_PATH_STYLE=${AWS_BACKUP_PATH_STYLE:-false}
AWS_BACKUP_ACCESS_KEY_ID=${AWS_BACKUP_ACCESS_KEY_ID}
AWS_BACKUP_SECRET_ACCESS_KEY=${AWS_BACKUP_SECRET_ACCESS_KEY}
AWS_BACKUP_BUCKET=${AWS_BACKUP_BUCKET}
AWS_BACKUP_MULTIPART_CHUNK_SIZE=${AWS_BACKUP_MULTIPART_CHUNK_SIZE:-104857600}
AWS_BACKUP_MULTIPART_CHUNK_SIZE=${AWS_BACKUP_MULTIPART_CHUNK_SIZE}

### GCS BACKUPS
GCS_BACKUPS=${GCS_BACKUPS:-false}
Expand Down
5 changes: 5 additions & 0 deletions assets/runtime/functions
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,11 @@ gitlab_configure_backups_aws() {
exec_as_git sed -i "/#start-aws/d" ${GITLAB_CONFIG}
exec_as_git sed -i "/#end-aws/d" ${GITLAB_CONFIG}

# Remove multipart config if we don't have it configured
if [[ -z ${AWS_BACKUP_MULTIPART_CHUNK_SIZE} ]]; then
exec_as_git sed -i "/#start-aws-multipart/,/#end-aws-multipart/d" ${GITLAB_CONFIG}
fi

if [[ -z ${AWS_BACKUP_REGION} && -z ${AWS_BACKUP_ENDPOINT} ]]; then
echo "\nMissing AWS region or endpoint. Aborting...\n"
return 1
Expand Down

0 comments on commit 75e60b6

Please sign in to comment.