uCPE Blueprint
[eliot.git] / blueprints / uCPE / ci_management / cleanup_edge_final.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 echo "nginx container stop"
19 if [ $NGINX != $CONSTZERO ]; then
20    sudo docker kill $(docker ps -q --filter ancestor=nginx:1.15.12 )
21 fi
22
23 echo "kubeproxy container stop"
24 if [ $KUBEPROXY != $CONSTZERO ]; then
25    sudo docker kill $(docker ps -q --filter ancestor=k8s.gcr.io/kube-proxy:v1.14.3 )
26 fi
27 echo "Finished"