Kubeedge cleanup and code optimisation
[eliot.git] / scripts / ci_management / cleanup_control.sh
diff --git a/scripts/ci_management/cleanup_control.sh b/scripts/ci_management/cleanup_control.sh
new file mode 100755 (executable)
index 0000000..574552b
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/bash -ex
+##############################################################################
+# Copyright (c) 2019 Huawei Tech and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# constants
+
+TESTYAML="testk8s-nginx.yaml"
+
+# start
+
+source ../src/config_kubeedge
+cd
+kubectl delete -f $TESTYAML
+
+sshpass -p ${EDGENODEPASSWORD} \
+scp ${PATH_OF_ELIOTFOLDER}/scripts/ci_management/cleanup_edge.sh \
+${EDGENODEUSR}@${EDGENODEIP}:$HOME_EDGENODE
+
+sshpass -p ${EDGENODEPASSWORD} ssh ${EDGENODEUSR}@${EDGENODEIP} \
+source cleanup_edge.sh
+
+cd $PATH_OF_ELIOTFOLDER/scripts/ci_management
+source cleanup_master.sh
+
+sshpass -p ${EDGENODEPASSWORD} \
+scp ${PATH_OF_ELIOTFOLDER}/scripts/ci_management/cleanup_edge_final.sh \
+${EDGENODEUSR}@${EDGENODEIP}:$HOME_EDGENODE
+
+sshpass -p ${EDGENODEPASSWORD} ssh ${EDGENODEUSR}@${EDGENODEIP} \
+source cleanup_edge_final.sh