blob: 9b56064797505e1744138594119bb80ea6be73e9 [file] [log] [blame]
Pavel Glazov26dcac02022-09-29 23:20:00 +04001node('sre-team-infra') {
2 timestamps() {
3 ansiColor('xterm') {
4 tmp_jenkins_config = '/dev/shm/sre-jenkins-job-builder.ini'
5 stage('Checkout') {
6 checkout scm
7 }
8 stage('Codenarc') {
9 try {
10 sh '''#!/bin/bash -ex
11 docker run --rm \
12 -t --user "\$(id -u):\$(id -g)" \
Pavel Glazov73179662022-10-05 14:29:37 +040013 -v ${WORKSPACE}:/ws \
Pavel Glazov26dcac02022-09-29 23:20:00 +040014 docker-prod-local.docker.mirantis.net/infra/codenarc:latest \
15 -rulesetfiles="rulesets/basic.xml" \
16 -maxPriority1Violations=0 \
17 -maxPriority2Violations=0 \
18 -maxPriority3Violations=0 \
19 -report=console \
Pavel Glazov73179662022-10-05 14:29:37 +040020 -report=html:/ws/report.html 2>&1 \
Pavel Glazov26dcac02022-09-29 23:20:00 +040021 | tee report.log
22 if [ "${PIPESTATUS[0]}" != '0' ]; then
23 exit 1
24 fi
25 '''
26 }
27 finally {
28 archiveArtifacts \
29 artifacts: "**/report.html",
30 allowEmptyArchive: false
31 }
32 }
33 stage ("Test python with pep8"){
34 sh """
35 set -e
36 tox
37 """
38 }
39 }
40 }
41}