-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
48 lines (48 loc) · 1.43 KB
/
Jenkinsfile
File metadata and controls
48 lines (48 loc) · 1.43 KB
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
#!/usr/bin/env groovy
pipeline{
agent any
// 可以设置环境变量
environment {
PATH = "/home/testhadoop/.pyenv/shims:$PATH"
runEnv = 'server'
}
//默认命令运行的pwd 为项目workspace
stages {
stage('Build') {
steps{
echo '='*50 + '开始构建' + '='*50
echo '---> 更新依赖包'
//sh 'pipenv install --skip-lock'
echo '---> 扫描用例信息'
//sh 'pipenv run python case_scanner.py'
echo 'build success!'
}
}
// stage可以添加或减少
stage('Test') {
steps{
echo 'This is a test step!'
}
}
stage('Deploy') {
steps{
echo 'This is a deploy step'
}
}
}
post {
failure{
script{
emailext attachLog: true,
// 邮件模板这里的引号一定要注意写对(坑)
body: '''${SCRIPT, template="groovy-html.template"}''',
mimeType: 'text/html',
charset:'UTF-8',
// PlatformGroup #10 构建失败
subject: "${currentBuild.fullDisplayName} 构建失败",
//用逗号或空格分隔多个邮箱
to: 'xxx@xx.com xxxx@xxx.com'
}
}
}
}