Merge "uCPE Blueprint"
[eliot.git] / blueprints / uCPE / scripts / ci_management / cleanup_prom_cadvisor.sh
1 #!/bin/bash -ex
2 ##############################################################################
3 # Copyright (c) 2019 Huawei Tech and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 # The script is to stop and remove the prometheus and cadvisor containers from
12 # ELIOT Manager and ELIOT Edge Node respectively.
13
14 # stop prometheus in ELIOT Manager
15 source uninstall_prometheus.sh | tee uninstall_prometheus.log
16
17 #stop cadvisor statement executed at ELIOT Edge Node
18 stop_cadvisor_atedge="cd eliot/blueprints/uCPE/scripts/ci_management && source uninstall_cadvisor.sh"
19 # Read all the Worker Node details from nodelist file.
20 while read line
21 do
22      nodeinfo="${line}"
23      nodeusr=$(echo ${nodeinfo} | cut -d"|" -f1)
24      nodeip=$(echo ${nodeinfo} | cut -d"|" -f2)
25      nodepaswd=$(echo ${nodeinfo} | cut -d"|" -f3)
26      sshpass -p ${nodepaswd} ssh ${nodeusr}@${nodeip} ${stop_cadvisor_atedge}
27 done < ../nodelist > /dev/null 2>&1
28