From 600548d4df9d788585aaa6549bcab38c0f34d9ee Mon Sep 17 00:00:00 2001 From: Parker Berberian Date: Fri, 28 Jun 2019 10:52:52 -0400 Subject: 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 --- jjb/ci_gate_security/opnfv-ci-gate-security.yaml | 1 - jjb/global/releng-macros.yaml | 11 +++- jjb/global/slave-params.yaml | 4 +- jjb/laas/laas.yml | 70 ++++++++++++++++++++++++ jjb/laas/shell/backup-dashboard.sh | 28 ++++++++++ jjb/laas/shell/deploy-dashboard.sh | 19 +++++++ jjb/pharos/pharos-tools.yml | 70 ------------------------ jjb/pharos/shell/backup-dashboard.sh | 28 ---------- jjb/pharos/shell/deploy-dashboard.sh | 19 ------- jjb/releng/opnfv-docker.yaml | 14 ++--- 10 files changed, 134 insertions(+), 130 deletions(-) create mode 100644 jjb/laas/laas.yml create mode 100644 jjb/laas/shell/backup-dashboard.sh create mode 100644 jjb/laas/shell/deploy-dashboard.sh delete mode 100644 jjb/pharos/pharos-tools.yml delete mode 100644 jjb/pharos/shell/backup-dashboard.sh delete mode 100644 jjb/pharos/shell/deploy-dashboard.sh diff --git a/jjb/ci_gate_security/opnfv-ci-gate-security.yaml b/jjb/ci_gate_security/opnfv-ci-gate-security.yaml index ff0ade3dd..06b192e7d 100644 --- a/jjb/ci_gate_security/opnfv-ci-gate-security.yaml +++ b/jjb/ci_gate_security/opnfv-ci-gate-security.yaml @@ -50,7 +50,6 @@ - ovsnfv - parser - pharos - - pharos-tools - promise - qtip - releng diff --git a/jjb/global/releng-macros.yaml b/jjb/global/releng-macros.yaml index d1986ec72..8756a911d 100644 --- a/jjb/global/releng-macros.yaml +++ b/jjb/global/releng-macros.yaml @@ -867,9 +867,14 @@ <<: *email_ptl_defaults recipients: > jack@jento.io -- publisher: - name: 'email-pharos-tools-ptl' - <<: *email_pharos_ptl_defaults + +- publisher: &email_laas_ptl_defaults + name: 'email-laas-ptl' + publishers: + - email-ext: + <<: *email_laas_ptl_defaults + recipients: > + pberberian@iol.unh.edu - publisher: name: 'email-promise-ptl' diff --git a/jjb/global/slave-params.yaml b/jjb/global/slave-params.yaml index 1a8ce417f..c483bd1f5 100644 --- a/jjb/global/slave-params.yaml +++ b/jjb/global/slave-params.yaml @@ -629,11 +629,11 @@ description: "Directory where the build artifact will be located upon the completion of the build." - parameter: - name: 'pharos-dashboard-defaults' + name: 'laas-dashboard-defaults' parameters: - label: name: SLAVE_LABEL - default: 'pharos-dashboard2' + default: 'laas-dashboard' description: 'Slave label on Jenkins' all-nodes: false node-eligibility: 'ignore-offline' 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/ diff --git a/jjb/pharos/pharos-tools.yml b/jjb/pharos/pharos-tools.yml deleted file mode 100644 index e28d0be6f..000000000 --- a/jjb/pharos/pharos-tools.yml +++ /dev/null @@ -1,70 +0,0 @@ ---- -- project: - name: pharos-dashboard-jobs - - project: 'pharos-tools' - project-name: 'pharos-tools' - - stream: - - master - - disabled: false - - jobs: - - 'pharos-dashboard-backup' - - 'pharos-dashboard-deploy' - -- project: - name: pharos-dashboard-verify - - project: 'pharos-tools' - project-name: 'pharos-tools' - build-days-to-keep: 7 - tox-dir: 'dashboard' - - stream: - - master - - disabled: false - - jobs: - - 'gerrit-tox-verify' - -- job-template: - name: 'pharos-dashboard-backup' - - disabled: '{obj:disabled}' - - parameters: - - 'pharos-dashboard-defaults' - - triggers: - - timed: '@daily' - - builders: - - shell: - !include-raw: shell/backup-dashboard.sh - -- job-template: - name: 'pharos-dashboard-deploy' - - disabled: '{obj:disabled}' - - parameters: - - project-parameter: - project: '{project}' - branch: 'master' - - 'pharos-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/pharos/shell/backup-dashboard.sh b/jjb/pharos/shell/backup-dashboard.sh deleted file mode 100644 index 4c1c01500..000000000 --- a/jjb/pharos/shell/backup-dashboard.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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 deleted file mode 100644 index 46a79c326..000000000 --- a/jjb/pharos/shell/deploy-dashboard.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/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:/pharos_dashboard/account/ -docker cp $HOME/rsa.pem $WEB_CONTAINER:/pharos_dashboard/account/ diff --git a/jjb/releng/opnfv-docker.yaml b/jjb/releng/opnfv-docker.yaml index 85ddbf09e..f284843cb 100644 --- a/jjb/releng/opnfv-docker.yaml +++ b/jjb/releng/opnfv-docker.yaml @@ -15,7 +15,7 @@ stream: hunter branch: 'stable/{stream}' disabled: false - pharos-tools-receivers: &pharos_tools_receivers + laas-receivers: &laas_receivers receivers: > pberberian@iol.unh.edu sbergeron@iol.unh.edu @@ -200,18 +200,18 @@ project: 'nfvbench' <<: *master <<: *other-receivers - - 'pharos-tools-laas-dashboard': - project: 'pharos-tools' + - 'laas-dashboard': + project: 'laas' dockerdir: 'dashboard' dockerfile: 'web/Dockerfile' <<: *master - <<: *pharos_tools_receivers - - 'pharos-tools-laas-celery': - project: 'pharos-tools' + <<: *laas_receivers + - 'laas-celery': + project: 'laas' dockerdir: 'dashboard' dockerfile: 'worker/Dockerfile' <<: *master - <<: *pharos_tools_receivers + <<: *laas_receivers - 'qtip': project: 'qtip' dockerdir: '.' -- cgit 1.2.3-korg