-
Notifications
You must be signed in to change notification settings - Fork 3
/
jenkinsfile.linter
35 lines (29 loc) · 1.18 KB
/
jenkinsfile.linter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import groovy.transform.Field
@Library("lib-groovy-jenkins@master") _
@Field def node_label="prodtest-1604"
@Field def failed_job=false
@Field def unstable_job=false
timestamps{
ansiColor('xterm'){
node(node_label){
if(env.gitlabBranch != null){
println("Detecting that the job was triggered by a GitLab merge request. Merge from ${env.gitlabBranch} into ${env.gitlabTargetBranch}")
env.branch_name = env.gitlabBranch
}
gitCheckout(this, env.branch_name, env.repository_url, "git-ssh")
try {
gitlabCommitStatus(connection: gitLabConnection('gitlab_connection'), name: env.JOB_NAME) {
installingTestsuite(this)
setupPythonEnvironment(this, ['pylint', 'pycodestyle'])
(unstable_job, failed_job) = lintPythonAndRecordResult(this, unstable_job, failed_job)
if (failed_job == true){
error "PEP8 Errors have been detected in the job"
}
}
}
finally {
claimBuild(this, failed_job, unstable_job)
}
}
}
}