From: Bartek Grzybowski Date: Wed, 26 Feb 2020 10:43:35 +0000 (+0100) Subject: Add linter job template/definition for integration repo X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=4d77b8e9a97c3801e0cab422c23e2f134b950191;p=ci-management.git Add linter job template/definition for integration repo Template leverages lf-infra-tox-* builders boilerplates to run arbitrary tox envs for specific file format linters. Change-Id: I4f130f6c68222d53dcf022f3fd4a2b41765eaf45 Signed-off-by: Bartek Grzybowski Issue-ID: INT-1427 --- diff --git a/jjb/integration/integration-templates.yaml b/jjb/integration/integration-templates.yaml index 0adfae7a9..0cf19bcff 100644 --- a/jjb/integration/integration-templates.yaml +++ b/jjb/integration/integration-templates.yaml @@ -43,3 +43,56 @@ publishers: - lf-infra-publish + +- job-template: + # Job template for running linters against specific file formats + # + # Required Variables: + # python-version: Python version to deploy in venv + # tox-env: Tox environments to run + # tox-dir: Directory containing the project's tox.ini + # pattern: List of file patterns to scan + + name: '{project-name}-{stream}-{subproject}-lint' + project-type: freestyle + description: 'Job intended for running linters with Tox and Coala' + node: ubuntu1604-builder-2c-1g + + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '{stream}' + branch: '{branch}' + - lf-infra-tox-parameters: + tox-dir: '{tox-dir}' + tox-envs: '{tox-envs}' + + properties: + - infra-properties: + build-days-to-keep: '{build-days-to-keep}' + + scm: + - gerrit-trigger-scm: + refspec: '$GERRIT_REFSPEC' + choosing-strategy: 'gerrit' + submodule-recursive: '{submodule-recursive}' + + wrappers: + - infra-wrappers: + build-timeout: '{build-timeout}' + + triggers: + - gerrit-trigger-patch-submitted: + server: '{server-name}' + project: '{project}' + branch: '{branch}' + files: '{pattern}' + + builders: + - lf-infra-tox-install: + python-version: '{python-version}' + - lf-infra-tox-run: + parallel: 'false' + + publishers: + - lf-infra-publish diff --git a/jjb/integration/integration.yaml b/jjb/integration/integration.yaml index eba9b1713..8d4d52e48 100644 --- a/jjb/integration/integration.yaml +++ b/jjb/integration/integration.yaml @@ -36,11 +36,9 @@ name: integration-verify-vagrantfile project-name: 'integration' project: 'integration' - stream: - 'master': branch: 'master' - jobs: - '{project-name}-{stream}-verify-vagrantfile' @@ -86,3 +84,23 @@ jobs: - gerrit-docker-verify - gerrit-docker-merge + +- project: + name: integration-linters + project: 'integration' + project-name: 'integration' + python-version: python3 + jobs: + - '{project-name}-{stream}-{subproject}-lint' + subproject: + - 'yaml': + tox-dir: '.' + tox-envs: 'yaml' + pattern: '**/*.yaml|**/*.yml' + - 'json': + tox-dir: '.' + tox-envs: 'json' + pattern: '**/*.json' + stream: + - 'master': + branch: 'master'