summaryrefslogtreecommitdiffstats
path: root/jjb/pharos/pharos.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/pharos/pharos.yaml')
-rw-r--r--jjb/pharos/pharos.yaml88
1 files changed, 88 insertions, 0 deletions
diff --git a/jjb/pharos/pharos.yaml b/jjb/pharos/pharos.yaml
new file mode 100644
index 000000000..c1bb1ba0e
--- /dev/null
+++ b/jjb/pharos/pharos.yaml
@@ -0,0 +1,88 @@
+---
+- project:
+ name: pharos
+
+ project:
+ - '{name}'
+ - '{name}-tools'
+
+ disabled: false
+
+ jobs:
+ - '{project}-verify-basic'
+ - 'backup-pharos-dashboard'
+ - 'deploy-pharos-dashboard':
+ disabled: true
+
+- job-template:
+ name: 'backup-pharos-dashboard'
+
+ disabled: '{obj:disabled}'
+
+ parameters:
+ - 'pharos-dashboard-defaults'
+
+ triggers:
+ - timed: '@daily'
+
+ builders:
+ - shell: |
+ 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 --rm \
+ -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_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"
+
+- job-template:
+ name: 'deploy-pharos-dashboard'
+
+ disabled: '{obj:disabled}'
+
+ parameters:
+ - project-parameter:
+ project: 'pharos-tools'
+ branch: 'master'
+ - 'pharos-dashboard-defaults'
+
+ scm:
+ - git:
+ choosing-strategy: 'gerrit'
+ refspec: '$GERRIT_REFSPEC'
+ branches:
+ - 'origin/$BRANCH'
+ timeout: 15
+ credentials-id: '$SSH_CREDENTIAL_ID'
+ url: '$GIT_BASE'
+ skip-tag: true
+ wipe-workspace: false
+
+ triggers:
+ - gerrit:
+ server-name: 'gerrit.opnfv.org'
+ trigger-on:
+ - ref-updated-event
+ - comment-added-contains-event:
+ comment-contains-value: '^redeploy$'
+ projects:
+ - project-compare-type: 'ANT'
+ project-pattern: 'pharos-tools'
+ branches:
+ - branch-compare-type: 'ANT'
+ branch-pattern: '**/master'
+
+ builders:
+ - shell: |
+ cp $HOME/config.env $WORKSPACE/dashboard
+ cp $HOME/rsa.pub $WORKSPACE/dashboard
+ cp $HOME/rsa.pem $WORKSPACE/dashboard
+ cd $WORKSPACE/dashboard
+ sudo docker-compose build
+ sudo docker-compose up -d