summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
Diffstat (limited to 'jjb')
-rwxr-xr-xjjb/securedlab/check-jinja2.sh9
-rw-r--r--jjb/securedlab/check-jinja2.yml80
2 files changed, 89 insertions, 0 deletions
diff --git a/jjb/securedlab/check-jinja2.sh b/jjb/securedlab/check-jinja2.sh
new file mode 100755
index 000000000..be4d951ed
--- /dev/null
+++ b/jjb/securedlab/check-jinja2.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set +x
+set -o errexit
+for lab_configs in $(find labs/ -name 'pod.yaml' | grep -v zte); do
+ while IFS= read -r jinja_templates; do
+ echo "./utils/generate_config.py -y $lab_configs -j $jinja_templates"
+ ./utils/generate_config.py -y $lab_configs -j $jinja_templates
+ done < <(find installers/ -name '*.jinja2')
+done
diff --git a/jjb/securedlab/check-jinja2.yml b/jjb/securedlab/check-jinja2.yml
new file mode 100644
index 000000000..1e85536e7
--- /dev/null
+++ b/jjb/securedlab/check-jinja2.yml
@@ -0,0 +1,80 @@
+########################
+# Job configuration to validate jninja2 files
+########################
+- project:
+
+ name: validate-templates
+
+ project: 'securedlab'
+
+ jobs:
+ - 'validate-jinja2-templates-{stream}'
+
+ stream:
+ - master:
+ branch: '{stream}'
+ disabled: false
+ - danube:
+ branch: 'stable/{stream}'
+ disabled: false
+
+########################
+# job templates
+########################
+
+- job-template:
+ name: 'validate-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: 'utils/generate_config.yml'
+ - compare-type: ANT
+ pattern: '**/*.jinja2'
+ - compare-type: ANT
+ pattern: '**/*.yaml'
+ builders:
+ - check-jinja
+
+- builder:
+ name: check-jinja
+ builders:
+ - shell:
+ !include-raw-escape: ./check-jinja2.sh