Merge "Home page carousel"
[eliot.git] / blueprints / iotgateway / scripts / ci_management / cleanup_edge.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 # constants
12
13 NGINX=$(sudo docker ps | grep nginx | wc -l)
14 KUBEPROXY=$(sudo docker ps | grep k8s.gcr.io | wc -l)
15 CONSTZERO="0"
16
17 # start
18
19 source config_kubeedge > /dev/null 2>&1
20 source ~/.profile
21
22 cd
23
24 if [ -d "$GOPATH/src/github.com/kubeedge/kubeedge/keadm" ]; then
25    cd $GOPATH/src/github.com/kubeedge/kubeedge/keadm
26    ./keadm reset --k8sserverip $MASTERNODEIP:8080
27 fi
28
29 cd /etc/kubeedge
30
31 if [ -f "certs.tgz" ]; then
32    sudo rm -rf certs.tgz
33 fi
34
35 if [ -d "/etc/kubeedge/ca" ]; then
36    sudo rm -rf /etc/kubeedge/ca
37 fi
38
39 if [ -d "/etc/kubeedge/certs" ]; then
40    sudo rm -rf /etc/kubeedge/certs
41 fi
42
43 if [ -d "/root/go/src" ]; then
44    sudo rm -rf /root/go/src
45 fi
46
47 # stop binaries edge_core
48 cd /usr/local/bin
49
50 if [ -f "edge_core" ]; then
51    sudo rm edge_core
52 fi
53