summaryrefslogtreecommitdiffstats
path: root/jjb/laas/shell/backup-dashboard.sh
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-06-28 10:52:52 -0400
committerParker Berberian <pberberian@iol.unh.edu>2019-10-29 13:54:25 -0400
commit600548d4df9d788585aaa6549bcab38c0f34d9ee (patch)
treed7c9b86be42c0e55b0499e40fd5b918d9f46bee4 /jjb/laas/shell/backup-dashboard.sh
parentb7871b1916fc8941c39950a9fb05308432a3a065 (diff)
Moves LaaS Jobs to New Project
Moves all existing jobs from pharos-tools into laas Google storage locations are created on the fly, so no problem changing them. Change-Id: Ic3df7a261af58f3cfce0dc85ef6428c7fb0196f6 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'jjb/laas/shell/backup-dashboard.sh')
-rw-r--r--jjb/laas/shell/backup-dashboard.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/jjb/laas/shell/backup-dashboard.sh b/jjb/laas/shell/backup-dashboard.sh
new file mode 100644
index 000000000..39f5be4e4
--- /dev/null
+++ b/jjb/laas/shell/backup-dashboard.sh
@@ -0,0 +1,28 @@
+#!/bin/bash -eux
+##############################################################################
+# Copyright (c) 2018 Linux Foundation 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
+##############################################################################
+
+BACKUP_DIR=$HOME/backups
+DATE=$(date +%Y%m%d)
+TAR_FILE=laas-dashboard-db-$DATE.tar.tz
+
+mkdir -p $BACKUP_DIR
+echo "-- $DATE --"
+echo "--> Backing up Lab as a Service Dashboard"
+
+docker run --rm \
+ -v laas-data:/laas-data:ro \
+ -v $BACKUP_DIR:/backup \
+ alpine \
+ tar -czf /backup/$TAR_FILE -C /laas-data ./
+
+/usr/local/bin/gsutil cp $BACKUP_DIR/$TAR_FILE \
+ gs://opnfv-backups/laas-dashboard/ && rm $BACKUP_DIR/$TAR_FILE
+
+echo "--> LAAS dashboard backup complete"