summaryrefslogtreecommitdiffstats
path: root/jjb/laas
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/laas')
-rw-r--r--jjb/laas/laas.yml70
-rw-r--r--jjb/laas/shell/backup-dashboard.sh28
-rw-r--r--jjb/laas/shell/deploy-dashboard.sh19
3 files changed, 117 insertions, 0 deletions
diff --git a/jjb/laas/laas.yml b/jjb/laas/laas.yml
new file mode 100644
index 000000000..76c475eab
--- /dev/null
+++ b/jjb/laas/laas.yml
@@ -0,0 +1,70 @@
+---
+- project:
+ name: laas-dashboard-jobs
+
+ project: 'laas'
+ project-name: 'laas'
+
+ stream:
+ - master
+
+ disabled: false
+
+ jobs:
+ - 'laas-dashboard-backup'
+ - 'laas-dashboard-deploy'
+
+- project:
+ name: laas-dashboard-verify
+
+ project: 'laas'
+ project-name: 'laas'
+ build-days-to-keep: 7
+ tox-dir: 'dashboard'
+
+ stream:
+ - master
+
+ disabled: false
+
+ jobs:
+ - 'gerrit-tox-verify'
+
+- job-template:
+ name: 'laas-dashboard-backup'
+
+ disabled: '{obj:disabled}'
+
+ parameters:
+ - 'laas-dashboard-defaults'
+
+ triggers:
+ - timed: '@daily'
+
+ builders:
+ - shell:
+ !include-raw: shell/backup-dashboard.sh
+
+- job-template:
+ name: 'laas-dashboard-deploy'
+
+ disabled: '{obj:disabled}'
+
+ parameters:
+ - project-parameter:
+ project: '{project}'
+ branch: 'master'
+ - 'laas-dashboard-defaults'
+
+ scm:
+ - git-scm-gerrit
+
+ triggers:
+ - gerrit-trigger-change-merged:
+ branch: 'master'
+ project: '{project}'
+ files: 'dashboard/docker-compose.yml'
+
+ builders:
+ - shell:
+ !include-raw: shell/deploy-dashboard.sh
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"
diff --git a/jjb/laas/shell/deploy-dashboard.sh b/jjb/laas/shell/deploy-dashboard.sh
new file mode 100644
index 000000000..d3ad29b31
--- /dev/null
+++ b/jjb/laas/shell/deploy-dashboard.sh
@@ -0,0 +1,19 @@
+#!/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
+cd $WORKSPACE/dashboard
+
+docker-compose pull
+docker-compose up -d
+
+# Copy JIRA keys into web container
+WEB_CONTAINER="$(docker ps --filter 'name=dg01' -q)"
+docker cp $HOME/rsa.pub $WEB_CONTAINER:/laas_dashboard/account/
+docker cp $HOME/rsa.pem $WEB_CONTAINER:/laas_dashboard/account/