forked from SUSE/caasp-salt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.flake8
43 lines (38 loc) · 1.25 KB
/
Jenkinsfile.flake8
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
36
37
38
39
40
41
42
43
def targetBranch = env.getEnvironment().get('CHANGE_TARGET', env.BRANCH_NAME)
library "kubic-jenkins-library@${targetBranch}"
// TODO: Don't hardcode salt repo name, find the right place
// to lookup this information dynamically.
githubCollaboratorCheck(
org: 'kubic-project',
repo: 'salt',
user: env.CHANGE_AUTHOR,
credentialsId: 'github-token')
def label = "salt-flake8-${UUID.randomUUID().toString()}"
podTemplate(label: label, containers: [
containerTemplate(
name: 'tox',
image: 'registry.suse.de/devel/casp/ci/opensuse_leap_42.3_containers/jenkins-tox-container:latest',
alwaysPullImage: true,
ttyEnabled: true,
command: 'cat',
envVars: [
envVar(key: 'http_proxy', value: env.http_proxy),
envVar(key: 'https_proxy', value: env.http_proxy),
],
),
]) {
node(label) {
stage('Retrieve Code') {
checkout scm
}
stage('Style Checks') {
container('tox') {
try {
sh 'tox -e flake8 -- --format=junit-xml --output-file junit.xml'
} finally {
junit "junit.xml"
}
}
}
}
}