summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail <mzhnichkov@mirantis.com>2017-03-02 16:55:53 +0400
committerMikhail <mzhnichkov@mirantis.com>2017-03-02 17:27:48 +0400
commitc0e356e704e7e7843e3af800d4396c3bf0e9d951 (patch)
tree03e7c78a909bac42a5157f81baf9bb4a99ecd522
parent6d351b3fc23e80d28c040eff40d3a1588024a192 (diff)
Add upgrade definition
Notes
Notes (review): Code-Review+2: Yuriy Taraday <yorik.sar@gmail.com> Code-Review+2: Andrey Pavlov <apavlov@mirantis.com> Workflow+1: Andrey Pavlov <apavlov@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 14 Mar 2017 12:46:44 +0000 Reviewed-on: https://review.openstack.org/440532 Project: openstack/fuel-ccp-designate Branch: refs/heads/master
-rw-r--r--docker/designate-upgrade/Dockerfile.j27
-rw-r--r--service/files/backup.sh.j210
-rw-r--r--service/upgrade/default.yaml56
3 files changed, 73 insertions, 0 deletions
diff --git a/docker/designate-upgrade/Dockerfile.j2 b/docker/designate-upgrade/Dockerfile.j2
new file mode 100644
index 0000000..ce93e38
--- /dev/null
+++ b/docker/designate-upgrade/Dockerfile.j2
@@ -0,0 +1,7 @@
1FROM {{ image_spec("designate-base") }}
2MAINTAINER {{ maintainer }}
3
4RUN apt-get install -y --no-install-recommends \
5 mysql-client \
6 && apt-get clean
7
diff --git a/service/files/backup.sh.j2 b/service/files/backup.sh.j2
new file mode 100644
index 0000000..dc00a4d
--- /dev/null
+++ b/service/files/backup.sh.j2
@@ -0,0 +1,10 @@
1#!/bin/bash -ex
2set -o pipefail
3BACKUP_FILE_API="/var/ccp/backup/designate/backup-$(date "+%Y%m%d%H%M%S")-api.sql"
4mysqldump {% if db.tls.enabled %} --ssl-mode REQUIRED {% endif %} -h {{ address(service.database) }} \
5 -u {{ designate.db.username }} -p{{ designate.db.password }} \
6 --single-transaction {{ designate.db.name.main_database }} > "${BACKUP_FILE_API}"
7BACKUP_FILE_POOL="/var/ccp/backup/designate/backup-$(date "+%Y%m%d%H%M%S")-pool.sql"
8mysqldump {% if db.tls.enabled %} --ssl-mode REQUIRED {% endif %} -h {{ address(service.database) }} \
9 -u {{ designate.db.username }} -p{{ designate.db.password }} \
10 --single-transaction {{ designate.db.name.pool_manager }} > "${BACKUP_FILE_POOL}"
diff --git a/service/upgrade/default.yaml b/service/upgrade/default.yaml
new file mode 100644
index 0000000..447886d
--- /dev/null
+++ b/service/upgrade/default.yaml
@@ -0,0 +1,56 @@
1upgrade:
2 name: upgrade-designate
3 image: designate-upgrade
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/designate
12 type: host
13 readOnly: false
14 topology_key: backup
15 - name: kill-services
16 type: kill-services
17 - name: designate-api-syncdb
18 files:
19 - designate-conf
20 type: single
21 command: designate-manage --config-file /etc/designate/designate.conf database sync
22 - name: start-designate-central
23 type: rolling-upgrade
24 services:
25 - designate-api
26 - designate-central
27 - name: designate-pool-update
28 files:
29 - pools
30 - designate-conf
31 type: single
32 command: designate-manage pool update --file /etc/designate/pools.yaml
33 - name: designate-pool-sync
34 dependencies:
35 - designate-pool-manager-db-create
36 files:
37 - designate-conf
38 type: single
39 command: designate-manage --config-file /etc/designate/designate.conf pool-manager-cache sync
40 - name: start-other-services
41 type: rolling-upgrade
42 services:
43 - designate-pool-manager
44 - designate-mdns
45 - designate-zone-manager
46files:
47 designate-conf:
48 path: /etc/designate/designate.conf
49 content: designate.conf.j2
50 pools:
51 path: /etc/designate/pools.yaml
52 content: pools.yaml.j2
53 backup-sh:
54 path: /opt/ccp/bin/backup.sh
55 content: backup.sh.j2
56 perm: "500"