-
Notifications
You must be signed in to change notification settings - Fork 14
/
Jenkinsfile
72 lines (72 loc) · 2.04 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
pipeline {
agent {
kubernetes {
label 'regression-retrieval'
inheritFrom 'performance'
defaultContainer 'regression-retrieval'
nodeSelector 'srcd.host/type=jenkins-worker'
containerTemplate {
name 'regression-retrieval'
image 'srcd/regression-retrieval:latest'
ttyEnabled true
command 'cat'
}
}
}
environment {
GOPATH = "/go"
GO_IMPORT_PATH = "github.com/src-d/regression-retrieval"
GO_IMPORT_FULL_PATH = "${env.GOPATH}/src/${env.GO_IMPORT_PATH}"
GO111MODULE = "on"
PROM_ADDRESS = "http://prom-pushgateway-prometheus-pushgateway.monitoring.svc.cluster.local:9091"
PROM_JOB = "retrieval_performance"
}
triggers { pollSCM('0 0,12 * * *') }
stages {
stage('Run performance tests') {
when { branch 'master' }
steps {
sh '/bin/regression-retrieval --kind=gitcollector --csv --prom local:HEAD'
}
}
stage('PR-run') {
when { changeRequest target: 'master' }
steps {
sh '/bin/regression-retrieval --kind=gitcollector remote:master local:HEAD'
}
}
stage('Plot') {
when { branch 'master' }
steps {
script {
plotFiles = findFiles(glob: "plot_*.csv")
plotFiles.each {
echo "plot ${it.getName()}"
sh "cat ${it.getName()}"
plot(
group: 'performance',
csvFileName: it.getName(),
title: it.getName(),
numBuilds: '100',
style: 'line',
csvSeries: [[
displayTableFlag: false,
exclusionValues: '',
file: it.getName(),
inclusionFlag: 'OFF',
]]
)
}
}
}
}
}
post {
success {
slackSend (color: '#2eb886', message: "SUCCESS: `${env.JOB_NAME}` <${env.BUILD_URL}|build #${env.BUILD_NUMBER}>")
}
failure {
slackSend (color: '#b82e60', message: "FAILED: `${env.JOB_NAME}` <${env.BUILD_URL}|build #${env.BUILD_NUMBER}>")
}
}
}