Create tcp-qa-ci-gerrit with JJB
Change-Id: I749e01a8f48ebb2fc17a86c25fe6a559f908af15
diff --git a/jobs/pipelines/gate-tcp-qa.groovy b/jobs/pipelines/gate-tcp-qa.groovy
new file mode 100644
index 0000000..9f62e8f
--- /dev/null
+++ b/jobs/pipelines/gate-tcp-qa.groovy
@@ -0,0 +1,41 @@
+node('sre-team-infra') {
+ timestamps() {
+ ansiColor('xterm') {
+ tmp_jenkins_config = '/dev/shm/sre-jenkins-job-builder.ini'
+ stage('Checkout') {
+ checkout scm
+ }
+ stage('Codenarc') {
+ try {
+ sh '''#!/bin/bash -ex
+ docker run --rm \
+ -t --user "\$(id -u):\$(id -g)" \
+ -w \$PWD -v ${WORKSPACE}:/shared \
+ docker-prod-local.docker.mirantis.net/infra/codenarc:latest \
+ -rulesetfiles="rulesets/basic.xml" \
+ -maxPriority1Violations=0 \
+ -maxPriority2Violations=0 \
+ -maxPriority3Violations=0 \
+ -report=console \
+ -report=html:/shared/report.html 2>&1 \
+ | tee report.log
+ if [ "${PIPESTATUS[0]}" != '0' ]; then
+ exit 1
+ fi
+ '''
+ }
+ finally {
+ archiveArtifacts \
+ artifacts: "**/report.html",
+ allowEmptyArchive: false
+ }
+ }
+ stage ("Test python with pep8"){
+ sh """
+ set -e
+ tox
+ """
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/jobs/project.yaml b/jobs/project.yaml
index 7b9597a..edd3db6 100644
--- a/jobs/project.yaml
+++ b/jobs/project.yaml
@@ -56,6 +56,7 @@
- self-deploy-virtualenvs
- cleanup-jenkins-agents
- tcp-qa-ci
+ - tcp-qa-gerrit
# - testrail-reporter-ci - can't moved to JJB, unsupported parameters
# - testrail-reporter-gerrit-mcp-ci - can't moved to JJB, unsupported parameters
- release-artifact-checker
diff --git a/jobs/templates/tcp-qa-gerrit.yml b/jobs/templates/tcp-qa-gerrit.yml
new file mode 100644
index 0000000..6432cdb
--- /dev/null
+++ b/jobs/templates/tcp-qa-gerrit.yml
@@ -0,0 +1,39 @@
+- job-template:
+ project-type: pipeline
+ description: '{job-description}'
+ concurrent: true
+ disabled: false
+ name: tcp-qa-gerrit
+ parameters:
+ - string:
+ default: ''
+ description: |-
+ Example: refs/changes/89/411189/36
+ (for now - only one reference allowed)
+ name: GERRIT_REFSPEC
+ trim: 'false'
+ triggers:
+ - gerrit:
+ server-name: 'mcp-ci-gerrit'
+ projects:
+ - project-compare-type: PLAIN
+ project-pattern: mcp/tcp-qa
+ branches:
+ - branch-pattern: 'master'
+ - comment-added-contains-event:
+ comment-contains-value: '(recheck|reverify|retest)'
+ pipeline-scm:
+ lightweight-checkout: false
+ scm:
+ - git:
+ branches:
+ - FETCH_HEAD
+ refspec: ${{GERRIT_REFSPEC}}
+ url: https://gerrit.mcp.mirantis.com/mcp/tcp-qa
+ script-path: jobs/pipelines/gate-tcp-qa.groovy
+ logrotate:
+ daysToKeep: 30
+ publishers:
+ - archive:
+ artifacts: 'build/report.html'
+ allow-empty: 'true'
\ No newline at end of file
diff --git a/jobs/view.yaml b/jobs/view.yaml
index 307c4c6..32ed948 100644
--- a/jobs/view.yaml
+++ b/jobs/view.yaml
@@ -156,6 +156,7 @@
- diff_params_reclass_system
- environment-template-ci
- tcp-qa-ci
+ - tcp-qa-gerrit
- test_cleanup
- testrail-reporter-ci
- testrail-reporter-gerrit-mcp-ci