-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
95 lines (94 loc) · 4.09 KB
/
Jenkinsfile
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// WARNING this file is maintained in the ITK repo, local changes will be
// overwritten as part of the release process.
pipeline {
agent { label 'default' }
triggers {
pollSCM 'H * * * *'
}
options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '25')
disableConcurrentBuilds()
}
stages {
stage('Build') {
steps {
sh 'python3.6 bootstrap.py'
sh 'bin/buildout -c jenkins.cfg'
}
}
stage('Analysis') {
steps {
script {
if (fileExists('bin/jenkins-code-analysis')) {
sh 'bin/jenkins-code-analysis'
sloccountPublish encoding: '', pattern: 'parts/jenkins-test/sloccount.sc', ignoreBuildFailure: true
warnings canComputeNew: false,
canResolveRelativePaths: false,
categoriesPattern: '',
canRunOnFailed: true,
parserConfigurations: [[parserName: 'a11y-lint', pattern: 'parts/code-analysis/a11y-lint.log'],
[parserName: 'chameleon-lint', pattern: 'code-analysis/chameleon-lint.log'],
[parserName: 'cleanlines', pattern: 'parts/code-analysis/clean-lines.log'],
[parserName: 'importchecker', pattern: 'parts/code-analysis/importchecker.log'],
[parserName: 'i18ndude', pattern: 'parts/code-analysis/find-untranslated.log'],
[parserName: 'flake8', pattern: 'parts/code-analysis/flake8.log'],
[parserName: 'JSLint', pattern: 'parts/code-analysis/jshint.xml'],
[parserName: 'stylelint', pattern: 'parts/code-analysis/stylelint.log'],
[parserName: 'xmllint', pattern: 'parts/code-analysis/xmllint.log']], unHealthy: '', unstableTotalAll: '0'
}
}
}
}
stage('Test') {
steps {
script {
if (fileExists('bin/jenkins-test-karma')) {
sh 'bin/jenkins-test-karma'
}
if (fileExists('bin/jenkins-test-coverage')) {
sh 'bin/jenkins-test-coverage'
}
else if (fileExists('bin/jenkins-test')) {
sh 'bin/jenkins-test'
}
}
}
}
}
post {
always {
script {
if (fileExists('parts/jenkins-test/testreports')) {
junit 'parts/jenkins-test/testreports/*.xml'
}
if (fileExists('bin/jenkins-test-coverage')) {
cobertura autoUpdateHealth: false,
autoUpdateStability: false,
coberturaReportFile: 'parts/jenkins-test/coverage.xml',
conditionalCoverageTargets: '70, 0, 0',
failNoReports: false,
failUnhealthy: false,
failUnstable: false,
lineCoverageTargets: '80, 0, 0',
maxNumberOfBuilds: 0,
methodCoverageTargets: '80, 0, 0',
onlyStable: false,
sourceEncoding: 'ASCII',
zoomCoverageChart: false
}
}
}
failure {
stash name: 'workspace', useDefaultExcludes: false
node('longlived') {
deleteDir()
unstash 'workspace'
script {
committerEmail = sh(script: 'git --no-pager show -s --format=\'%ae\'', returnStdout: true).trim()
}
sh "hostname -I > .nodeip"
emailext body: '${DEFAULT_CONTENT}', subject: '${DEFAULT_SUBJECT}', to: "${committerEmail}"
}
}
}
}