diff options
Diffstat (limited to 'jjb/pharos')
-rw-r--r-- | jjb/pharos/check-jinja2.yml | 87 | ||||
-rw-r--r-- | jjb/pharos/pharos.yml | 75 |
2 files changed, 129 insertions, 33 deletions
diff --git a/jjb/pharos/check-jinja2.yml b/jjb/pharos/check-jinja2.yml new file mode 100644 index 000000000..8ee2a2aa1 --- /dev/null +++ b/jjb/pharos/check-jinja2.yml @@ -0,0 +1,87 @@ +--- +######################## +# Job configuration to validate jinja2 files +######################## +- project: + + name: validate-pdf-templates + + project: 'pharos' + + jobs: + - 'validate-pdf-jinja2-templates-{stream}' + + stream: + - master: + branch: '{stream}' + disabled: false + - euphrates: + branch: 'stable/{stream}' + disabled: false + +######################## +# job templates +######################## + +- job-template: + name: 'validate-pdf-jinja2-templates-{stream}' + + disabled: '{obj:disabled}' + + concurrent: true + + parameters: + - project-parameter: + project: $GERRIT_PROJECT + branch: '{branch}' + - node: + name: SLAVE_NAME + description: Slave to execute jnija template test + default-slaves: + - lf-build1 + allowed-multiselect: true + ignore-offline-nodes: true + + scm: + - git-scm-gerrit + + triggers: + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - patchset-created-event: + exclude-drafts: 'false' + exclude-trivial-rebase: 'false' + exclude-no-code-change: 'false' + - draft-published-event + - comment-added-contains-event: + comment-contains-value: 'recheck' + - comment-added-contains-event: + comment-contains-value: 'reverify' + projects: + - project-compare-type: 'REG_EXP' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: ANT + pattern: '**/*.yaml' + - compare-type: ANT + pattern: 'config/installers/**/*.j2' + - compare-type: ANT + pattern: 'check-jinja2.sh' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + + builders: + - check-pdf-jinja + +- builder: + name: check-pdf-jinja + builders: + - shell: | + $WORKSPACE/config/utils/check-jinja2.sh diff --git a/jjb/pharos/pharos.yml b/jjb/pharos/pharos.yml index 7af4f0fa6..e1628250d 100644 --- a/jjb/pharos/pharos.yml +++ b/jjb/pharos/pharos.yml @@ -1,8 +1,4 @@ --- -################################################### -# All the jobs except verify have been removed! -# They will only be enabled on request by projects! -################################################### - project: name: pharos @@ -10,29 +6,50 @@ - '{name}' - '{name}-tools' + disabled: false + jobs: - - '{project}-verify-{stream}' + - '{project}-verify-basic' + - 'backup-pharos-dashboard' + - 'deploy-pharos-dashboard' + +- job-template: + name: 'backup-pharos-dashboard' + + disabled: '{obj:disabled}' + + parameters: + - 'pharos-dashboard-defaults' + + triggers: + - timed: '@daily' - stream: - - master: - branch: '{stream}' - gs-pathname: '' - disabled: false - - euphrates: - branch: 'stable/{stream}' - gs-pathname: '/{stream}' - disabled: false + 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: '{project}-verify-{stream}' + name: 'deploy-pharos-dashboard' disabled: '{obj:disabled}' parameters: - project-parameter: - project: '{project}' - branch: '{branch}' - - 'opnfv-build-ubuntu-defaults' + project: 'pharos-tools' + branch: 'master' + - 'pharos-dashboard-defaults' scm: - git-scm-gerrit @@ -41,26 +58,18 @@ - gerrit: server-name: 'gerrit.opnfv.org' trigger-on: - - patchset-created-event: - exclude-drafts: 'false' - exclude-trivial-rebase: 'false' - exclude-no-code-change: 'false' - - draft-published-event - - comment-added-contains-event: - comment-contains-value: 'recheck' + - ref-updated-event - comment-added-contains-event: - comment-contains-value: 'reverify' + comment-contains-value: '^redeploy$' projects: - project-compare-type: 'ANT' - project-pattern: '{project}' + project-pattern: 'pharos-tools' branches: - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - disable-strict-forbidden-file-verification: 'true' - forbidden-file-paths: - - compare-type: ANT - pattern: 'docs/**|.gitignore' + branch-pattern: '**/master' builders: - shell: | - echo "Nothing to verify!" + cd $WORKSPACE/dashboard + sudo docker-compose build + sudo docker-compose up -d |