Add backup step to upgrade

Depends-On: I3b51b7a957735873b0de098578e1b83c586f111a
Change-Id: I7901e11d4687e7932de4149c25b3cb705d49599f
This commit is contained in:
Yuriy Taraday 2016-11-17 01:33:48 +03:00
parent 674e26a391
commit cb6a8a40a2
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,6 @@
#!/bin/bash -ex
set -o pipefail
BACKUP_FILE="/var/ccp/backup/neutron/backup-$(date "+%Y%m%d%H%M%S").sql"
mysqldump -h {{ address(service.database) }} \
-u {{ neutron.db.username }} -p{{ neutron.db.password }} \
--single-transaction {{ neutron.db.name }} > "${BACKUP_FILE}"

View File

@ -1,7 +1,17 @@
upgrade:
name: upgrade-neutron
image: neutron-server
image: neutron-base
steps:
- name: backup
command: /opt/ccp/bin/backup.sh
files:
- backup-sh
volumes:
- name: backup-dir
path: /var/ccp/backup/neutron
type: host
readOnly: false
topology_key: backup
- name: expand
command: neutron-db-manage upgrade --expand
files:
@ -30,3 +40,7 @@ files:
path: /etc/neutron/neutron.conf
content: neutron.conf.j2
perm: "0600"
backup-sh:
path: /opt/ccp/bin/backup.sh
content: backup.sh.j2
perm: "500"