summaryrefslogtreecommitdiffstats
path: root/patches/opnfv-fuel/0019-ci-deploy.sh-states-bash-debug-continue-on-err.patch
blob: 36e8abc5885b0a450a78d3bd60d650ac74ba5165 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Wed, 23 Aug 2017 16:28:04 +0200
Subject: [PATCH] ci/deploy.sh, states: bash debug, continue on err

Since we don't `set -e` in state files, applying each state will
always succeed unless the last instruction in the state fails.
Make this uniform by always succeeding in applying the state.

While at it, enable bash debugging logs, for better readability
of deploy log files.

Change-Id: I3cf4886f6d73c6fd1380df1a4e1413334bec1701
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
 ci/deploy.sh                      | 2 +-
 mcp/config/states/dpdk            | 3 +++
 mcp/config/states/maas            | 2 ++
 mcp/config/states/networks        | 1 +
 mcp/config/states/neutron_compute | 3 +++
 mcp/config/states/opendaylight    | 3 +++
 mcp/config/states/openstack       | 3 +++
 mcp/config/states/openstack_ha    | 3 +++
 8 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/ci/deploy.sh b/ci/deploy.sh
index 2b4e724..5582727 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -336,7 +336,7 @@ for state in "${cluster_states[@]}"; do
     notify "STATE: ${state}\n" 2
     # shellcheck disable=SC2086,2029
     ssh ${SSH_OPTS} "ubuntu@${SALT_MASTER}" \
-        sudo "/root/fuel/mcp/config/states/${state}"
+        sudo "/root/fuel/mcp/config/states/${state} || true"
 done

 popd > /dev/null
diff --git a/mcp/config/states/dpdk b/mcp/config/states/dpdk
index 8834d47..c6cd2a5 100755
--- a/mcp/config/states/dpdk
+++ b/mcp/config/states/dpdk
@@ -1,3 +1,6 @@
+#!/bin/bash
+set -x
+
 salt -I 'nova:compute' system.reboot
 while true; do salt -I 'nova:compute' test.ping | fgrep -q 'Not connected' || break; done
 salt -I 'nova:compute' state.sls linux.network.dpdk
diff --git a/mcp/config/states/maas b/mcp/config/states/maas
index 080bbf5..12ef9ed 100755
--- a/mcp/config/states/maas
+++ b/mcp/config/states/maas
@@ -1,4 +1,6 @@
 #!/bin/bash
+set -x
+
 function wait_for() {
   local total_attempts=$1; shift
   local cmdstr=$@
diff --git a/mcp/config/states/networks b/mcp/config/states/networks
index fced1eb..bd6e923 100755
--- a/mcp/config/states/networks
+++ b/mcp/config/states/networks
@@ -1,4 +1,5 @@
 #!/bin/bash
+set -x

 # Determine public network based on external IPs from compute node
 # NOTE: mask currently hardcoded to /24
diff --git a/mcp/config/states/neutron_compute b/mcp/config/states/neutron_compute
index e2ffec6..d581621 100755
--- a/mcp/config/states/neutron_compute
+++ b/mcp/config/states/neutron_compute
@@ -1 +1,4 @@
+#!/bin/bash
+set -x
+
 salt -I 'neutron:compute' state.sls neutron
diff --git a/mcp/config/states/opendaylight b/mcp/config/states/opendaylight
index 3b1cf75..bee4c85 100755
--- a/mcp/config/states/opendaylight
+++ b/mcp/config/states/opendaylight
@@ -1,3 +1,6 @@
+#!/bin/bash
+set -x
+
 salt -I 'opendaylight:server' state.sls opendaylight
 salt -I 'opendaylight:client' state.sls opendaylight.client
 salt -I 'neutron:server' state.sls opendaylight.client
diff --git a/mcp/config/states/openstack b/mcp/config/states/openstack
index 23aaf72..270bf35 100755
--- a/mcp/config/states/openstack
+++ b/mcp/config/states/openstack
@@ -1,3 +1,6 @@
+#!/bin/bash
+set -x
+
 salt -I 'rabbitmq:server' state.sls rabbitmq
 salt -I 'rabbitmq:server' cmd.run "rabbitmqctl status"

diff --git a/mcp/config/states/openstack_ha b/mcp/config/states/openstack_ha
index 4a39d51..2597e82 100755
--- a/mcp/config/states/openstack_ha
+++ b/mcp/config/states/openstack_ha
@@ -1,3 +1,6 @@
+#!/bin/bash
+set -x
+
 salt -I 'keepalived:cluster' state.sls keepalived -b 1
 salt -I 'keepalived:cluster' pillar.get keepalived:cluster:instance:VIP:address