From f4908f1bd3b8599866d504bb5a1c1b25be719fcb Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 23 Oct 2020 06:48:38 +0800 Subject: [PATCH] Jenkinsfile: add flake8 check Signed-off-by: Kefu Chai --- Jenkinsfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..bf44e6d0 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,30 @@ +#!/usr/bin/env groovy + +pipeline { + agent { + label 'python3' + } + options { + timeout(time: 1, unit: 'HOURS') + } + stages { + stage ('flake8') { + steps { + sh '''#!/usr/bin/env bash + virtualenv -q --python python3 venv + . venv/bin/activate + pip install tox + tox -e pep8 -- --tee --output-file=flake8.txt + ''' + } + } + } + post { + failure { + script { + def flake8_issues = scanForIssues tool: flake8(pattern:'flake8.txt') + publishIssues id: 'cbt-flake8', name: 'cbt-flake8', issues: [flake8_issues] + } + } + } +}