-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile
58 lines (46 loc) · 1.36 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
node() {
def err = null
currentBuild.result = "SUCCESS"
try {
stage 'Checkout'
checkout scm
stage 'Install dependencies'
sh 'sudo pip install pep8 pep257 coverage'
stage 'pep checks'
sh 'pep8 openam --ignore=E501'
sh 'pep257 openam'
sh 'coverage report -m --fail-under=85'
stage 'Validate on OpenAM 12'
sh 'bash scripts/start_docker.sh 12.0.0'
sh 'python setup.py test'
stop_docker()
stage 'Validate on OpenAM 13'
sh 'bash scripts/start_docker.sh 13.0.0'
sh 'python setup.py test'
stop_docker()
}
catch (caughtError) {
err = caughtError
currentBuild.result = "FAILURE"
stop_docker()
}
finally {
if (err) {
throw err
}
}
}
def notifyFailed() {
emailext (
subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: """<p>FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at "<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>""",
replyTo: 'jenkins@dj-wasabi.nl',
to: 'werner@dj-wasabi.nl',
attachLog: true
)
}
def stop_docker() {
stage 'Stop container'
sh 'bash scripts/stop_docker.sh'
}