Add backup command to upgrade
Depends-On: I3ea3cb4342f66da4ead91e945baaddd799522bcf Change-Id: I95612568b4bcbad52dba95b3275e7465027f3917
This commit is contained in:
parent
d4e93847cd
commit
8ce8211722
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash -ex
|
||||||
|
set -o pipefail
|
||||||
|
BACKUP_FILE="/var/ccp/backup/keystone/backup-$(date "+%Y%m%d%H%M%S").sql"
|
||||||
|
mysqldump -h {{ address(service.database) }} \
|
||||||
|
-u {{ keystone.db.username }} -p{{ keystone.db.password }} \
|
||||||
|
--single-transaction {{ keystone.db.name }} > "${BACKUP_FILE}"
|
|
@ -2,6 +2,15 @@ upgrade:
|
||||||
name: upgrade-keystone
|
name: upgrade-keystone
|
||||||
image: keystone
|
image: keystone
|
||||||
steps:
|
steps:
|
||||||
|
- name: backup
|
||||||
|
command: /opt/ccp/bin/backup.sh
|
||||||
|
files:
|
||||||
|
- backup-sh
|
||||||
|
volumes:
|
||||||
|
- name: backup-dir
|
||||||
|
path: /var/ccp/backup/keystone
|
||||||
|
type: host
|
||||||
|
readOnly: false
|
||||||
- name: expand
|
- name: expand
|
||||||
files:
|
files:
|
||||||
- keystone-conf
|
- keystone-conf
|
||||||
|
@ -20,3 +29,7 @@ files:
|
||||||
keystone-conf:
|
keystone-conf:
|
||||||
path: /etc/keystone/keystone.conf
|
path: /etc/keystone/keystone.conf
|
||||||
content: keystone.conf.j2
|
content: keystone.conf.j2
|
||||||
|
backup-sh:
|
||||||
|
path: /opt/ccp/bin/backup.sh
|
||||||
|
content: backup.sh.j2
|
||||||
|
perm: "500"
|
||||||
|
|
Loading…
Reference in New Issue