Browse Source

Merge "Add upgrade definition"

changes/36/452636/1
Jenkins 2 years ago
parent
commit
1bda76bd07
3 changed files with 50 additions and 0 deletions
  1. 5
    0
      docker/heat-upgrade/Dockerfile.j2
  2. 6
    0
      service/files/backup.sh.j2
  3. 39
    0
      service/upgrade/default.yaml

+ 5
- 0
docker/heat-upgrade/Dockerfile.j2 View File

@@ -0,0 +1,5 @@
1
+FROM {{ image_spec("heat-base") }}
2
+MAINTAINER {{ maintainer }}
3
+
4
+RUN apt-get install -y --no-install-recommends mysql-client \
5
+    && apt-get clean

+ 6
- 0
service/files/backup.sh.j2 View File

@@ -0,0 +1,6 @@
1
+#!/bin/bash -ex
2
+set -o pipefail
3
+BACKUP_FILE="/var/ccp/backup/heat/backup-$(date "+%Y%m%d%H%M%S").sql"
4
+mysqldump {% 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}"

+ 39
- 0
service/upgrade/default.yaml View File

@@ -0,0 +1,39 @@
1
+upgrade:
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
32
+files:
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"

Loading…
Cancel
Save