-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
133 lines (128 loc) 路 4.99 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
pipeline {
agent {
label 'linux'
}
environment {
CI = 'true'
}
stages {
stage('Preparing binaries') {
agent {
label 'linux'
}
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE'){
sh 'cd /home/jenkins/go/src/infini.sh/loadgen && git fetch && git reset --hard origin/master'
sh 'cd /home/jenkins/go/src/infini.sh/gateway && git fetch && git reset --hard origin/master'
sh 'cd /home/jenkins/go/src/infini.sh/testing && git fetch && git reset --hard origin/main && git clean -dfx'
sh label: 'build-loadrun', script: 'cd /home/jenkins/go/src/infini.sh/loadgen/cmd/loadrun && make build && cp ./bin/loadrun /home/jenkins/go/src/infini.sh/testing/bin/'
sh label: 'build-gateway', script: 'cd /home/jenkins/go/src/infini.sh/gateway && make build && cp ./bin/gateway /home/jenkins/go/src/infini.sh/testing/bin/'
sh label: 'build-loadgen', script: 'cd /home/jenkins/go/src/infini.sh/loadgen && make build && cp ./bin/loadgen /home/jenkins/go/src/infini.sh/testing/bin/'
}
}
}
stage('Running Testing Suites') {
parallel {
stage('Testing Gateway') {
stages {
stage('Testing Gateway against Elasticsearch 7.10.2') {
agent {
label 'linux'
}
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE'){
sh label: 'testing-gateway', script: 'cd /home/jenkins/go/src/infini.sh/testing && ./bin/loadrun -config ./suites/jenkins/gateway-uat-es710.yml'
}
}
post {
unsuccessful {
sh script: '/home/jenkins/bin/notify-feishu.py "[Testing Gateway against Elasticsearch 7.10.2] tests failed" "" "$BUILD_URL"'
}
}
}
stage('Testing Gateway against Elasticsearch 8.6.x') {
agent {
label 'linux'
}
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE'){
sh label: 'testing-gateway', script: 'cd /home/jenkins/go/src/infini.sh/testing && ./bin/loadrun -config ./suites/jenkins/gateway-uat-es86.yml'
}
}
post {
unsuccessful {
sh script: '/home/jenkins/bin/notify-feishu.py "[Testing Gateway against Elasticsearch 8.6.x] tests failed" "" "$BUILD_URL"'
}
}
}
stage('Testing Gateway against EasySearch 1.0') {
agent {
label 'linux'
}
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE'){
sh label: 'testing-gateway', script: 'cd /home/jenkins/go/src/infini.sh/testing && ./bin/loadrun -config ./suites/jenkins/gateway-uat-easysearch.yml'
}
}
post {
unsuccessful {
sh script: '/home/jenkins/bin/notify-feishu.py "[Testing Gateway against EasySearch 1.0] tests failed" "" "$BUILD_URL"'
}
}
}
}
}
stage('Testing Loadgen') {
agent {
label 'linux'
}
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE'){
sh label: 'testing-loadgen', script: 'cd /home/jenkins/go/src/infini.sh/testing && ./bin/loadrun -config ./suites/jenkins/loadgen-uat.yml'
}
}
post {
unsuccessful {
sh script: '/home/jenkins/bin/notify-feishu.py "[Testing Loadgen] tests failed" "" "$BUILD_URL"'
}
}
}
stage('Benchmarking Gateway') {
agent {
label 'linux'
}
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE'){
sh label: 'benchmark-gateway', script: 'cd /home/jenkins/go/src/infini.sh/testing && ./bin/loadrun -config ./suites/jenkins/gateway-benchmark.yml'
}
}
post {
unsuccessful {
sh script: '/home/jenkins/bin/notify-feishu.py "[Benchmarking Gateway] tests failed" "" "$BUILD_URL"'
}
}
}
stage('Testing EasySearch') {
agent {
label 'linux'
}
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE'){
sh label: 'testing-easysearch', script: 'cd /home/jenkins/go/src/infini.sh/testing && ./bin/loadrun -config ./suites/jenkins/easysearch-uat.yml'
}
}
post {
unsuccessful {
sh script: '/home/jenkins/bin/notify-feishu.py "[Testing EasySearch] tests failed" "" "$BUILD_URL"'
}
}
}
}
}
}
post {
unsuccessful {
sh script: '/home/jenkins/bin/notify-feishu.py "[testing] jenkins build failed" "" "$BUILD_URL"'
}
}
}