-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
44 lines (44 loc) · 1.56 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
pipeline {
agent any
stages {
stage('Dev_Test') {
steps {
script{
dir ('d:\\tmp\\yj_auto') {
bat 'for %%i in (*.xml,*.html) do @del %%i'
echo 'starting auto test...'
try{
bat 'robot --pythonpath . --test *1001 -L debug cases'
}
catch (err) {
echo 'test fail!!!'
}
bat '''python spend.py %BUILD_URL%'''
}
}
}
}
}
post {
always {
bat "copy d:\\tmp\\yj_auto\\daily_report.html d:\\SoftWare\\Jenkins\\workspace\\yj"
}
success {
mail bcc: '', body: "构建版本成功", cc: '', charset: 'UTF-8', from: '[email protected]', mimeType: 'text/plain', replyTo: '', subject: "构建版本成功", to: "[email protected]";
}
failure {
emailext (
subject: '构建版本失败',body: '''${FILE,path="daily_report.html"}''',
from: '[email protected]', mimeType: 'text/html',
to: '[email protected]'
)
}
unstable {
echo 'This will run only if the run was marked as unstable'
}
changed {
echo 'This will run only if the state of the Pipeline has changed'
echo 'For example, if the Pipeline was previously failing but is now successful'
}
}
}