summaryrefslogtreecommitdiffstats
path: root/utils/test/dashboard/backup-db.sh
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-09-22 15:25:05 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-09-22 15:25:05 +0000
commit1b3487ca931821ef762ad103a32118dc99a6fb71 (patch)
treea517f172a5cc6b353165e0ead0a1a5fceeaa5414 /utils/test/dashboard/backup-db.sh
parent279e9db83e49f7f7b1358071b3d669f4a810cbb6 (diff)
parente7b7bb64bf2f3f03980504d80f304e4859146ed2 (diff)
Merge "rebuild directory structure of Kibana dashboard"
Diffstat (limited to 'utils/test/dashboard/backup-db.sh')
-rw-r--r--utils/test/dashboard/backup-db.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/utils/test/dashboard/backup-db.sh b/utils/test/dashboard/backup-db.sh
new file mode 100644
index 000000000..35c3fbe5a
--- /dev/null
+++ b/utils/test/dashboard/backup-db.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2016 Orange 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
+##############################################################################
+echo "Backup Test collection DB"
+now=$(date +"%m_%d_%Y_%H_%M_%S")
+echo $now
+echo " ------------- "
+TARGET_DIR=./$now
+TEST_RESULT_DB_BACKUP="test_collection_db."$now".tar.gz"
+
+echo "Create Directory for backup"
+mkdir -p $TARGET_DIR
+
+echo "Export results"
+mongoexport --db test_results_collection -c results --out $TARGET_DIR/backup-results.json
+echo "Export test cases"
+mongoexport --db test_results_collection -c testcases --out $TARGET_DIR/backup-cases.json
+echo "Export projects"
+mongoexport --db test_results_collection -c projects --out $TARGET_DIR/backup-projects.json
+echo "Export pods"
+mongoexport --db test_results_collection -c pods --out $TARGET_DIR/backup-pod.json
+
+echo "Create tar.gz"
+#tar -cvzf $TEST_RESULT_DB_BACKUP $TARGET_DIR
+
+echo "Delete temp directory"
+#rm -Rf $TARGET_DIR