Skip to content

Commit f4908f1

Browse files
committed
Jenkinsfile: add flake8 check
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
1 parent 86fc618 commit f4908f1

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Jenkinsfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env groovy
2+
3+
pipeline {
4+
agent {
5+
label 'python3'
6+
}
7+
options {
8+
timeout(time: 1, unit: 'HOURS')
9+
}
10+
stages {
11+
stage ('flake8') {
12+
steps {
13+
sh '''#!/usr/bin/env bash
14+
virtualenv -q --python python3 venv
15+
. venv/bin/activate
16+
pip install tox
17+
tox -e pep8 -- --tee --output-file=flake8.txt
18+
'''
19+
}
20+
}
21+
}
22+
post {
23+
failure {
24+
script {
25+
def flake8_issues = scanForIssues tool: flake8(pattern:'flake8.txt')
26+
publishIssues id: 'cbt-flake8', name: 'cbt-flake8', issues: [flake8_issues]
27+
}
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)