DCD-386: Add backup wrapper and some fixes.

This commit is contained in:
Steve Smith
2019-06-05 13:03:59 +10:00
parent 65886363a4
commit 76db370513
3 changed files with 22 additions and 1 deletions

View File

@@ -12,3 +12,9 @@
src: "bitbucket.diy-backup.vars.sh.j2"
dest: "{{ atl_diy_backup_dir }}/bitbucket.diy-backup.vars.sh"
mode: 0640
- name: Install backup wrapper script
template:
src: "run-backup.j2"
dest: "{{ atl_installation_base }}/bin/run-backup"
mode: 0750

View File

@@ -1,3 +1,5 @@
# Created by Ansible
INSTANCE_NAME={{ atl_aws_stack_name }}
AWS_INFO=$(curl -Lsf http://169.254.169.254/latest/dynamic/instance-identity/document)
@@ -9,7 +11,7 @@ AWS_EC2_INSTANCE_ID=$(echo "${AWS_INFO}" | jq -r .instanceId)
BITBUCKET_VERBOSE_BACKUP=true
KEEP_BACKUPS=5
{% if atl_ssl_proxy is defined and atl_ssl_proxy %}
{% if atl_ssl_proxy is defined and atl_ssl_proxy == 'true' %}
BITBUCKET_URL=https://{{ atl_proxy_name }}
{% else %}
BITBUCKET_URL=http://{{ atl_proxy_name }}

View File

@@ -0,0 +1,13 @@
#!/bin/bash
cd {{ atl_diy_backup_repo }}
if [[ -f .venv/bin/activate ]]; then
source .venv/bin/activate
else
virtualenv .venv
source .venv/bin/activate
pip install boto
fi
./bitbucket.diy-backup.sh