summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuriy Taraday <yorik.sar@gmail.com>2016-11-16 23:50:03 +0300
committerYuriy Taraday <yorik.sar@gmail.com>2016-11-18 20:08:51 +0300
commit8ce8211722c09623c78326208ca43fac48618381 (patch)
treee435bfdf8425a7b3e60c934729d6ccaa21a920e2
parentd4e93847cda48f7d1ed8ee9c2cb66b5775b11ba6 (diff)
Add backup command to upgrade
Notes
Notes (review): Code-Review+2: Proskurin Kirill <kproskurin@mirantis.com> Workflow+1: Proskurin Kirill <kproskurin@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 18 Nov 2016 17:16:22 +0000 Reviewed-on: https://review.openstack.org/398592 Project: openstack/fuel-ccp-keystone Branch: refs/heads/master
-rw-r--r--service/files/backup.sh.j26
-rw-r--r--service/upgrade/default.yaml13
2 files changed, 19 insertions, 0 deletions
diff --git a/service/files/backup.sh.j2 b/service/files/backup.sh.j2
new file mode 100644
index 0000000..88f2020
--- /dev/null
+++ b/service/files/backup.sh.j2
@@ -0,0 +1,6 @@
1#!/bin/bash -ex
2set -o pipefail
3BACKUP_FILE="/var/ccp/backup/keystone/backup-$(date "+%Y%m%d%H%M%S").sql"
4mysqldump -h {{ address(service.database) }} \
5 -u {{ keystone.db.username }} -p{{ keystone.db.password }} \
6 --single-transaction {{ keystone.db.name }} > "${BACKUP_FILE}"
diff --git a/service/upgrade/default.yaml b/service/upgrade/default.yaml
index b18510d..738e588 100644
--- a/service/upgrade/default.yaml
+++ b/service/upgrade/default.yaml
@@ -2,6 +2,15 @@ upgrade:
2 name: upgrade-keystone 2 name: upgrade-keystone
3 image: keystone 3 image: keystone
4 steps: 4 steps:
5 - name: backup
6 command: /opt/ccp/bin/backup.sh
7 files:
8 - backup-sh
9 volumes:
10 - name: backup-dir
11 path: /var/ccp/backup/keystone
12 type: host
13 readOnly: false
5 - name: expand 14 - name: expand
6 files: 15 files:
7 - keystone-conf 16 - keystone-conf
@@ -20,3 +29,7 @@ files:
20 keystone-conf: 29 keystone-conf:
21 path: /etc/keystone/keystone.conf 30 path: /etc/keystone/keystone.conf
22 content: keystone.conf.j2 31 content: keystone.conf.j2
32 backup-sh:
33 path: /opt/ccp/bin/backup.sh
34 content: backup.sh.j2
35 perm: "500"