blob: 15743490ca187be9a22d1a6a04fb46b6bd7b8ef8 [file] [log] [blame]
Vladimir Khlyunev645bb2d2023-06-22 17:52:53 +04001#!/bin/bash
2set -x
3
4TITLE="Comparison of tcp-qa deployments"
5RIGHT_NOW=$(date +"%x %r %Z")
6TIME_STAMP="Updated on $RIGHT_NOW by $USER"
7
8list_of_envs=(
9 heat-cicd-pike-dvr-sl
10 heat-cicd-queens-contrail41-sl
11 heat-cicd-queens-dvr-sl
12 heat-cicd-pike-contrail-stb-sl
13 released-heat-cicd-pike-contrail41-sl
14 released-heat-cicd-pike-dvr-sl
15 released-heat-cicd-queens-contrail41-sl
16 released-heat-cicd-queens-dvr-sl
17 bm-cicd-pike-ovs-maas
18 bm-cicd-queens-ovs-maas
Pavel Glazov64518f72024-02-28 20:32:10 +040019 bm-cicd-queens-ovs-cl-maas
Vladimir Khlyunev645bb2d2023-06-22 17:52:53 +040020 heat-bm-cicd-pike-contrail-sl
21 heat-bm-cicd-queens-contrail-sl
22 bm-e7-cicd-pike-ovs-maas
23 bm-e7-cicd-pike-odl-maas
24 bm-b300-cicd-queens-ovs-maas
25 bm-b300-e7-cicd-pike-ovs-maas
26)
27
28all_parameters=(
29 auditd_enabled
30 barbican_enabled
31 barbican_backend
32 barbican_integration_enabled
33 jenkins_slave_type
34 updates_mirantis_version
35 bmk_enabled
36 ceph_enabled
37 ceph_version
38 cicd_enabled
39 ceph_osd_backend
40 ceph_osd_mode
41 ceph_osd_data_disks
42 ceph_osd_journal_or_block_db_disks
43 ceph_osds_per_device
44 ceph_osd_data_size
45 ceph_osd_journal_size
46 ceph_osd_block_db_size
47 ceph_osd_dmcrypt
48 ceph_osd_node_count
49 ceph_osd_bond_mode
50 ceph_hyper_converged
51 rbd_monitoring_enabled
52 cinder_backup_engine
53 compute_padding_with_zeros
54 designate_enabled
55 designate_backend
56 fluentd_enabled
57 rsync_fernet_rotation
58 gainsight_service_enabled
59 galera_ssl_enabled
60 internal_proxy_enabled
61 ironic_enabled
62 kqueen_custom_mail_enabled
63 kqueen_enabled
64 kubernetes_enabled
65 maas_dhcp_enabled
66 maas_enabled
67 manila_enabled
68 mcp_version
69 nova_vnc_tls_enabled
70 octavia_manager_cluster
71 octavia_amphora_topology
72 octavia_spare_amphora_pool_size
73 opencontrail_api_ssl_enabled
74 opencontrail_enabled
75 opencontrail_version
76 openldap_enabled
77 openscap_enabled
78 openstack_enabled
79 openstack_cluster_size
80 openstack_mysql_x509_enabled
81 openstack_nfv_dpdk_enabled
82 openstack_nfv_sriov_enabled
83 openstack_network_engine
84 openstack_nova_compute_nfv_req_enabled
85 openstack_octavia_enabled
86 openstack_ovs_dvr_enabled
87 openstack_rabbitmq_x509_enabled
88 openstack_version
89 platform
90 rabbitmq_ssl_enabled
91 openstack_rabbitmq_standalone_mode
92 secrets_encryption_enabled
93 stacklight_enabled
94 stacklight_ssl_enabled
95 stacklight_version
96 static_ips_on_deploy_network_enabled
97 tenant_telemetry_enabled
98 upstream_proxy_enabled
99 version
100
101)
102
103function split_string
104{
105 str=$1
106
107 IFS=':' # set as delimiter
108 read -r id value <<< "$str" # str is read into an array as tokens separated by IFS
109 unset IFS
110 echo ${value}
111}
112
113
114function collect_parameter
115{
116 env=$1
117 parameter_key=$2
118
119 key_value=$(grep -w $parameter_key: tcp_tests/templates/$env/salt-context-cookiecutter*.yaml);
120 echo $(split_string "$key_value")
121}
122
123function clean
124{
125 str=$1
126 # first, strip underscores
127 CLEAN=${str//[^a-zA-Z0-9_.\/\{\}:]/}
128 CLEAN=`echo -n $CLEAN | tr A-Z a-z`
129 echo $CLEAN
130}
131
132function html_color
133{
134 str=$(clean $1)
135 if [ "$str" == "False" -o "$str" == "false" ]; then
136 echo "bgcolor=\"#ff9999\"";
137 fi
138 if [ "$str" == "True" -o "$str" == "true" ]; then
139 echo "bgcolor=\"#99cc99\"";
140 fi
141
142}
143
144function unpack_parameters
145{
146 for param in ${all_parameters[@]}; do
147 echo "<tr>";
148 echo "<td>";
149 echo "$param"
150 echo "</td>";
151 for env in ${list_of_envs[@]}; do
152 value=$(collect_parameter "$env" "$param")
153 echo "<td $(html_color $value)>";
154 echo $(clean $value)
155 echo "</td>";
156 done;
157 echo "</tr>";
158 done;
159}
160
161function unpack_envs
162{
163
164 echo "<tr>";
165 echo "<th>"
166 echo "</th>"
167 for env in ${list_of_envs[@]}; do
168 echo "<th>";
169 echo "$env"
170 echo "</th>";
171 done;
172 echo "</tr>";
173
174}
175
176function write_page
177{
178 cat <<- _EOF_
179 <html>
180 <head>
181 <title>$TITLE</title>
182 </head>
183 <body>
184 <h1>$TITLE</h1>
185 <p>$TIME_STAMP</p>
186 <table border=1 style="border-collapse:collapse;border-spacing:0">
187 $(unpack_envs)
188 $(unpack_parameters)
189 </table>
190 </body>
191 </html>
192_EOF_
193}
194
195
196filename=report.html
197
198write_page > $filename