mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-25 11:04:04 +03:00
10c85ce3d6
* Renamed local.yml to docker-compose.local.yml * Renamed production.yml to docker-compose.production.yml * Rename docs.yml to docker-compose.docs.yml * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
30 lines
823 B
Bash
30 lines
823 B
Bash
#!/bin/sh
|
|
|
|
### Upload the /backups folder to Amazon S3
|
|
###
|
|
### Usage:
|
|
### $ docker compose -f docker-compose.production.yml run --rm awscli upload
|
|
|
|
set -o errexit
|
|
set -o pipefail
|
|
set -o nounset
|
|
|
|
working_dir="$(dirname ${0})"
|
|
source "${working_dir}/_sourced/constants.sh"
|
|
source "${working_dir}/_sourced/messages.sh"
|
|
|
|
export AWS_ACCESS_KEY_ID="${DJANGO_AWS_ACCESS_KEY_ID}"
|
|
export AWS_SECRET_ACCESS_KEY="${DJANGO_AWS_SECRET_ACCESS_KEY}"
|
|
export AWS_STORAGE_BUCKET_NAME="${DJANGO_AWS_STORAGE_BUCKET_NAME}"
|
|
|
|
|
|
message_info "Upload the backups directory to S3 bucket {$AWS_STORAGE_BUCKET_NAME}"
|
|
|
|
aws s3 cp ${BACKUP_DIR_PATH} s3://${AWS_STORAGE_BUCKET_NAME}${BACKUP_DIR_PATH} --recursive
|
|
|
|
message_info "Cleaning the directory ${BACKUP_DIR_PATH}"
|
|
|
|
rm -rf ${BACKUP_DIR_PATH}/*
|
|
|
|
message_success "Finished uploading and cleaning."
|