summaryrefslogtreecommitdiffstats
path: root/jjb/pharos/shell
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2018-04-19 15:37:34 -0700
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2018-10-22 10:12:06 -0700
commitbbafa00756c3c742d31caa33da98ac0731a6c0a9 (patch)
tree191e472c0ba812adc361edabc37b2d86ff5aae5c /jjb/pharos/shell
parent9b164628deaf8bc495d4eabdb6458add7175cd32 (diff)
Update Pharos Dashboard Jobs
Moves the pharos dashboard jobs to their own file sperate and deploys the dashboard when changes are merged to master. Note: this may need to be manually triggered due to the timing between the container being built and it being availble to be pulled. Also includes the following changes to the job: - Uploads backups to Google Storage - Remove sudo usage as docker can be ran as the Jenkins user - Renames jobs to match general naming scheme JIRA: PHAROS-394 Change-Id: I516c4414d7b0158f1f8478214c10f0aa7d176739 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Diffstat (limited to 'jjb/pharos/shell')
-rw-r--r--jjb/pharos/shell/backup-dashboard.sh28
-rw-r--r--jjb/pharos/shell/deploy-dashboard.sh17
2 files changed, 45 insertions, 0 deletions
diff --git a/jjb/pharos/shell/backup-dashboard.sh b/jjb/pharos/shell/backup-dashboard.sh
new file mode 100644
index 000000000..4c1c01500
--- /dev/null
+++ b/jjb/pharos/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=pharos-dashboard-db-$DATE.tar.tz
+
+mkdir -p $BACKUP_DIR
+echo "-- $DATE --"
+echo "--> Backing up Pharos Dashboard"
+
+docker run --rm \
+ -v pharos-data:/pharos-data:ro \
+ -v $BACKUP_DIR:/backup \
+ alpine \
+ tar -czf /backup/$TAR_FILE -C /pharos-data ./
+
+/usr/local/bin/gsutil cp $BACKUP_DIR/$TAR_FILE \
+ gs://opnfv-backups/pharos-dashboard/ && rm $BACKUP_DIR/$TAR_FILE
+
+echo "--> Pharos dashboard backup complete"
diff --git a/jjb/pharos/shell/deploy-dashboard.sh b/jjb/pharos/shell/deploy-dashboard.sh
new file mode 100644
index 000000000..4ca41f48c
--- /dev/null
+++ b/jjb/pharos/shell/deploy-dashboard.sh
@@ -0,0 +1,17 @@
+#!/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
+##############################################################################
+
+cp $HOME/config.env $WORKSPACE/dashboard
+cp $HOME/rsa.pub $WORKSPACE/dashboard
+cp $HOME/rsa.pem $WORKSPACE/dashboard
+
+cd $WORKSPACE/dashboard
+docker-compose pull
+docker-compose up -d