Skip to content

Commit

Permalink
fix: bucket create error, upload error
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkoro committed Dec 28, 2023
1 parent 0537200 commit f8d3122
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fi

# Create the bucket if it does not exist
if ! s3cmd la --host="${DEFAULT_URL_PREFIX}://${S3_ENDPOINT#*.}" | grep "${S3_BUCKET}" > /dev/null; then
if ! s3cmd mb --host="${DEFAULT_URL_PREFIX}://${S3_ENDPOINT#*.}" s3://"${S3_BUCKET}" > /dev/null; then
if ! s3cmd mb s3://"${S3_BUCKET}" > /dev/null; then
errorMessage "Could not create bucket"
fi
infoMessage "Bucket created successfully"
Expand All @@ -88,7 +88,7 @@ infoMessage "Backup file created successfully"

# Upload backup file to s3
infoMessage "Uploading backup file to S3"
if ! s3cmd put --host="${DEFAULT_URL_PREFIX}://${S3_ENDPOINT#*.}" "/tmp/${BACKUP_NAME}_${CURRENT_DATE}.tar.gz" "s3://${S3_BUCKET}" > /dev/null; then
if ! s3cmd put "/tmp/${BACKUP_NAME}_${CURRENT_DATE}.tar.gz" s3://"${S3_BUCKET}" > /dev/null; then
errorMessage "Could not upload backup file to S3"
fi
infoMessage "Backup uploaded successfully"
Expand Down

0 comments on commit f8d3122

Please sign in to comment.