summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-03-21 10:45:11 +0000
committerGerrit Code Review <review@openstack.org>2017-03-21 10:45:11 +0000
commit1bda76bd07906f1f80049356834647da1df14335 (patch)
treedea7259b8db61c8b4b9810616197a75e19f14521
parent1907e25213632a30b4e886f407df60e01869406a (diff)
parent3bcc8c02b5182b6d81446a2408cb5ad5be18a211 (diff)
Merge "Add upgrade definition"
-rw-r--r--docker/heat-upgrade/Dockerfile.j25
-rw-r--r--service/files/backup.sh.j26
-rw-r--r--service/upgrade/default.yaml39
3 files changed, 50 insertions, 0 deletions
diff --git a/docker/heat-upgrade/Dockerfile.j2 b/docker/heat-upgrade/Dockerfile.j2
new file mode 100644
index 0000000..f94e70d
--- /dev/null
+++ b/docker/heat-upgrade/Dockerfile.j2
@@ -0,0 +1,5 @@
1FROM {{ image_spec("heat-base") }}
2MAINTAINER {{ maintainer }}
3
4RUN apt-get install -y --no-install-recommends mysql-client \
5 && apt-get clean \ No newline at end of file
diff --git a/service/files/backup.sh.j2 b/service/files/backup.sh.j2
new file mode 100644
index 0000000..8879600
--- /dev/null
+++ b/service/files/backup.sh.j2
@@ -0,0 +1,6 @@
1#!/bin/bash -ex
2set -o pipefail
3BACKUP_FILE="/var/ccp/backup/heat/backup-$(date "+%Y%m%d%H%M%S").sql"
4mysqldump {% if db.tls.enabled %} --ssl-mode REQUIRED {% endif %} -h {{ address("database") }} \
5 -u {{ heat.db.username }} -p{{ heat.db.password }} \
6 --single-transaction {{ heat.db.name }} > "${BACKUP_FILE}" \ No newline at end of file
diff --git a/service/upgrade/default.yaml b/service/upgrade/default.yaml
new file mode 100644
index 0000000..fa6b244
--- /dev/null
+++ b/service/upgrade/default.yaml
@@ -0,0 +1,39 @@
1upgrade:
2 name: upgrade-heat
3 image: heat-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/heat
12 type: host
13 readOnly: false
14 topology_key: backup
15 - name: kill-services
16 type: kill-services
17 - name: db-sync
18 command: heat-manage db_sync
19 files:
20 - heat-conf
21 - name: roll-api
22 type: rolling-upgrade
23 services:
24 - heat-api
25 - name: roll-api-cfn
26 type: rolling-upgrade
27 - heat-api-cfn
28 - name: roll-engine
29 type: rolling-upgrade
30 services:
31 - heat-engine
32files:
33 heat-conf:
34 path: /etc/heat/heat.conf
35 content: heat.conf.j2
36 backup-sh:
37 path: /opt/ccp/bin/backup.sh
38 content: backup.sh.j2
39 perm: "500"