summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2018-01-12 21:53:00 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-01-12 21:53:00 +0000
commitf4883a21eadcc5c8b87209617cfe823da6869cc8 (patch)
tree2ca57c94bab9080ac32d69ec8126388304934750 /jjb
parentc9aac428e09385a5893313a99b6af6652dafd216 (diff)
parentae8038cc86d14f56001127fd0b503444071ab402 (diff)
Merge "Update Pharos Backup Job"
Diffstat (limited to 'jjb')
-rw-r--r--jjb/pharos/pharos.yml23
1 files changed, 9 insertions, 14 deletions
diff --git a/jjb/pharos/pharos.yml b/jjb/pharos/pharos.yml
index 9f4feb42e..c721c8d87 100644
--- a/jjb/pharos/pharos.yml
+++ b/jjb/pharos/pharos.yml
@@ -16,28 +16,23 @@
disabled: '{obj:disabled}'
parameters:
- - project-parameter:
- project: 'pharos-tools'
- branch: 'master'
- 'pharos-dashboard-defaults'
- scm:
- - git-scm-gerrit
-
triggers:
- timed: '@daily'
builders:
- shell: |
- mkdir -p /home/backups/
- DATE=$(date +%Y%m%d)
- echo "-- $DATE --"
+ BACKUP_DIR=$HOME/backups/
+ TMP_DIR=$HOME/tmp/
+ mkdir -p $BACKUP_DIR
+ echo "-- $(date +%Y%m%d) --"
echo "Backing up Pharos Dashboard data..."
sudo docker run -it --rm \
- -v pharos_data:/pharos_data:ro \
- -v /tmp:/backup \
+ -v pharos-data:/pharos-data:ro \
+ -v $TMP_DIR:/backup \
alpine \
- tar -czf /backup/pharos-dashboard-db-$(date +%Y%m%d).tar.gz -C /pharos_data ./
- sudo mv /tmp/pharos-dashboard-db-$(date +%Y%m%d).tar.gz /home/backups/
- sudo chown $USER:$USER $WORKSPACE/backups/pharos-dashboard-db-$(date +%Y%m%d).tar.gz
+ tar -czf /backup/pharos-dashboard-db-$(date +%Y%m%d).tar.gz -C /pharos-data ./
+ sudo mv $TMP_DIR/pharos-dashboard-db-$(date +%Y%m%d).tar.gz $BACKUP_DIR
+ sudo chown $USER:$USER $BACKUP_DIR/pharos-dashboard-db-$(date +%Y%m%d).tar.gz
echo "...complete"