mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
DCD-386: Add backup wrapper and some fixes.
This commit is contained in:
@@ -12,3 +12,9 @@
|
|||||||
src: "bitbucket.diy-backup.vars.sh.j2"
|
src: "bitbucket.diy-backup.vars.sh.j2"
|
||||||
dest: "{{ atl_diy_backup_dir }}/bitbucket.diy-backup.vars.sh"
|
dest: "{{ atl_diy_backup_dir }}/bitbucket.diy-backup.vars.sh"
|
||||||
mode: 0640
|
mode: 0640
|
||||||
|
|
||||||
|
- name: Install backup wrapper script
|
||||||
|
template:
|
||||||
|
src: "run-backup.j2"
|
||||||
|
dest: "{{ atl_installation_base }}/bin/run-backup"
|
||||||
|
mode: 0750
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# Created by Ansible
|
||||||
|
|
||||||
INSTANCE_NAME={{ atl_aws_stack_name }}
|
INSTANCE_NAME={{ atl_aws_stack_name }}
|
||||||
|
|
||||||
AWS_INFO=$(curl -Lsf http://169.254.169.254/latest/dynamic/instance-identity/document)
|
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
|
BITBUCKET_VERBOSE_BACKUP=true
|
||||||
KEEP_BACKUPS=5
|
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 }}
|
BITBUCKET_URL=https://{{ atl_proxy_name }}
|
||||||
{% else %}
|
{% else %}
|
||||||
BITBUCKET_URL=http://{{ atl_proxy_name }}
|
BITBUCKET_URL=http://{{ atl_proxy_name }}
|
||||||
|
|||||||
13
roles/diy_backup/templates/run-backup.j2
Normal file
13
roles/diy_backup/templates/run-backup.j2
Normal 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
|
||||||
Reference in New Issue
Block a user