diff options
author | 2016-07-11 17:29:03 +0800 | |
---|---|---|
committer | 2016-07-12 14:16:55 +0800 | |
commit | f4db6375de91d5d77a0a98064c31af8590d82b4d (patch) | |
tree | 7fd0ebb8fdc6410a2967c04dfc2d423569c390ea /utils/test/result_collection_api/update/templates/rm_olds.sh | |
parent | 85b093248d8586f31300a06858905c4e79bde9c3 (diff) |
auto update of testAPI using ansible-playbook
rename db related files
write ansible file
update README.md
JIRA: FUNCTEST-360
Change-Id: Ib1a1a5ad846ed003cf90da770d94ceb7c011d39d
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/result_collection_api/update/templates/rm_olds.sh')
-rw-r--r-- | utils/test/result_collection_api/update/templates/rm_olds.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/test/result_collection_api/update/templates/rm_olds.sh b/utils/test/result_collection_api/update/templates/rm_olds.sh new file mode 100644 index 000000000..c6bca1867 --- /dev/null +++ b/utils/test/result_collection_api/update/templates/rm_olds.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +proc_number=`ps -ef | grep opnfv-testapi | grep -v grep | wc -l` +if [ $proc_number -gt 0 ]; then + procs=`ps -ef | grep opnfv-testapi | grep -v grep` + echo "begin to kill opnfv-testapi $procs" + ps -ef | grep opnfv-testapi | grep -v grep | awk '{print $2}' | xargs kill -kill &>/dev/null +fi + +number=`docker ps -a | awk 'NR != 1' | grep testapi | wc -l` +if [ $number -gt 0 ]; then + containers=number=`docker ps -a | awk 'NR != 1' | grep testapi` + echo "begin to rm containers $containers" + docker ps -a | awk 'NR != 1' | grep testapi | awk '{print $1}' | xargs docker rm -f &>/dev/null +fi |