forked from datastax/csharp-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
1032 lines (948 loc) · 31.7 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!groovy
def initializeEnvironment() {
env.DRIVER_DISPLAY_NAME = 'Cassandra C# Driver'
env.DRIVER_METRIC_TYPE = 'oss'
if (env.GIT_URL.contains('riptano/csharp-driver')) {
env.DRIVER_DISPLAY_NAME = 'private ' + env.DRIVER_DISPLAY_NAME
env.DRIVER_METRIC_TYPE = 'oss-private'
} else if (env.GIT_URL.contains('csharp-dse-driver')) {
env.DRIVER_DISPLAY_NAME = 'DSE C# Driver'
env.DRIVER_METRIC_TYPE = 'dse'
}
env.GIT_SHA = "${env.GIT_COMMIT.take(7)}"
env.GITHUB_PROJECT_URL = "https://${GIT_URL.replaceFirst(/(git@|http:\/\/|https:\/\/)/, '').replace(':', '/').replace('.git', '')}"
env.GITHUB_BRANCH_URL = "${GITHUB_PROJECT_URL}/tree/${env.BRANCH_NAME}"
env.GITHUB_COMMIT_URL = "${GITHUB_PROJECT_URL}/commit/${env.GIT_COMMIT}"
if (env.OS_VERSION.split('/')[0] == 'win') {
env.HOME = 'C:\\Users\\Admin'
env.HOME_WSL = '/mnt/c/Users/Admin'
powershell label: 'Copy SSL files', script: '''
wsl bash --login -c "cp -r $env:HOME_WSL/ccm/ssl `$HOME/ssl"
'''
powershell label: 'Download Apache Cassandra® or DataStax Enterprise', script: '''
rm $Env:HOME\\environment.txt
rm $Env:HOME\\driver-environment.ps1
wsl bash --login -c "$Env:CCM_ENVIRONMENT_SHELL_WINDOWS $Env:SERVER_VERSION"
wsl bash --login -c "cp ~/environment.txt $ENV:HOME_WSL"
$data = get-content "$Env:HOME\\environment.txt"
$data = $data -replace "`n","`r`n"
$newData = ""
$data | foreach {
$v1,$v2 = $_.split("=",2)
echo "1: $v1 2: $v2"
$newData += "`r`n`$Env:$v1='$v2'"
}
$newData += "`r`n`$Env:CASSANDRA_VERSION=`$Env:CCM_CASSANDRA_VERSION"
"$newData" | Out-File -filepath $Env:HOME\\driver-environment.ps1
'''
if (env.SERVER_VERSION.split('-')[0] == 'dse') {
powershell label: 'Update environment for DataStax Enterprise', script: '''
. $Env:HOME\\driver-environment.ps1
$newData = "`r`n`$Env:DSE_BRANCH=`"$Env:CCM_BRANCH`""
$newData += "`r`n`$Env:DSE_VERSION=`"$Env:CCM_VERSION`""
$newData += "`r`n`$Env:DSE_INITIAL_IPPREFIX=`"127.0.0.`""
$newData += "`r`n`$Env:DSE_IN_REMOTE_SERVER=`"false`""
"$newData" | Out-File -filepath $Env:HOME\\driver-environment.ps1 -append
'''
if (env.SERVER_VERSION.split('-')[1] == '6.0') {
powershell label: 'Update environment for DataStax Enterprise v6.0.x', script: '''
. $Env:HOME\\driver-environment.ps1
echo "Setting DSE 6.0 install-dir"
"`r`n`$Env:DSE_PATH=`"$Env:CCM_INSTALL_DIR`"" | Out-File -filepath $Env:HOME\\driver-environment.ps1 -append
'''
}
}
if (env.SERVER_VERSION == env.SERVER_VERSION_SNI_WINDOWS) {
powershell label: 'Update environment for SNI proxy tests', script: '''
$newData = "`r`n`$Env:SNI_ENABLED=`"true`""
$newData += "`r`n`$Env:SINGLE_ENDPOINT_PATH=`"$Env:HOME/proxy/run.ps1`""
$newData += "`r`n`$Env:SNI_CERTIFICATE_PATH=`"$Env:HOME/proxy/certs/client_key.pfx`""
$newData += "`r`n`$Env:SNI_CA_PATH=`"$Env:HOME/proxy/certs/root.crt`""
"$newData" | Out-File -filepath $Env:HOME\\driver-environment.ps1 -append
'''
}
powershell label: 'Set additional environment variables for windows tests', script: '''
$newData = "`r`n`$Env:PATH+=`";$env:JAVA_HOME\\bin`""
$newData += "`r`n`$Env:SIMULACRON_PATH=`"$Env:SIMULACRON_PATH_WINDOWS`""
$newData += "`r`n`$Env:CCM_USE_WSL=`"true`""
$newData += "`r`n`$Env:CCM_SSL_PATH=`"/root/ssl`""
"$newData" | Out-File -filepath $Env:HOME\\driver-environment.ps1 -append
'''
powershell label: 'Display .NET and environment information', script: '''
# Load CCM and driver configuration environment variables
cat $Env:HOME\\driver-environment.ps1
. $Env:HOME\\driver-environment.ps1
dotnet --version
gci env:* | sort-object name
'''
} else {
sh label: 'Copy SSL files', script: '''#!/bin/bash -le
cp -r ${HOME}/ccm/ssl $HOME/ssl
'''
sh label: 'Download Apache Cassandra® or DataStax Enterprise', script: '''#!/bin/bash -le
. ${CCM_ENVIRONMENT_SHELL} ${SERVER_VERSION}
echo "CASSANDRA_VERSION=${CCM_CASSANDRA_VERSION}" >> ${HOME}/environment.txt
'''
if (env.SERVER_VERSION.split('-')[0] == 'dse') {
sh label: 'Update environment for DataStax Enterprise', script: '''#!/bin/bash -le
# Load CCM environment variables
set -o allexport
. ${HOME}/environment.txt
set +o allexport
cat >> ${HOME}/environment.txt << ENVIRONMENT_EOF
CCM_PATH=${HOME}/ccm
DSE_BRANCH=${CCM_BRANCH}
DSE_INITIAL_IPPREFIX=127.0.0.
DSE_IN_REMOTE_SERVER=false
ENVIRONMENT_EOF
'''
if (env.SERVER_VERSION.split('-')[1] == '6.0') {
sh label: 'Update environment for DataStax Enterprise v6.0.x', script: '''#!/bin/bash -le
# Load CCM and driver configuration environment variables
set -o allexport
. ${HOME}/environment.txt
set +o allexport
echo "DSE_PATH=${CCM_INSTALL_DIR}" >> ${HOME}/environment.txt
'''
}
}
if (env.SERVER_VERSION == env.SERVER_VERSION_SNI && env.DOTNET_VERSION != 'mono') {
sh label: 'Update environment for SNI proxy tests', script: '''#!/bin/bash -le
# Load CCM and driver configuration environment variables
set -o allexport
. ${HOME}/environment.txt
set +o allexport
cat >> ${HOME}/environment.txt << ENVIRONMENT_EOF
SNI_ENABLED=true
SINGLE_ENDPOINT_PATH=${HOME}/proxy/run.sh
SNI_CERTIFICATE_PATH=${HOME}/proxy/certs/client_key.pfx
SNI_CA_PATH=${HOME}/proxy/certs/root.crt
ENVIRONMENT_EOF
'''
}
sh label: 'Display .NET and environment information', script: '''#!/bin/bash -le
# Load CCM and driver configuration environment variables
set -o allexport
. ${HOME}/environment.txt
set +o allexport
if [ ${DOTNET_VERSION} = 'mono' ]; then
mono --version
else
dotnet --version
fi
printenv | sort
'''
}
}
def installDependencies() {
if (env.OS_VERSION.split('/')[0] == 'win') {
powershell label: 'Download saxon', script: '''
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
mkdir saxon
Invoke-WebRequest -OutFile saxon/saxon9he.jar -Uri https://repo1.maven.org/maven2/net/sf/saxon/Saxon-HE/9.8.0-12/Saxon-HE-9.8.0-12.jar
'''
} else {
sh label: 'Download saxon', script: '''#!/bin/bash -le
mkdir saxon
curl -L -o saxon/saxon9he.jar https://repo1.maven.org/maven2/net/sf/saxon/Saxon-HE/9.8.0-12/Saxon-HE-9.8.0-12.jar
'''
if (env.DOTNET_VERSION == 'mono') {
sh label: 'Install required packages for mono builds', script: '''#!/bin/bash -le
# Define alias for Nuget
nuget() {
mono /usr/local/bin/nuget.exe "$@"
}
export -f nuget
nuget install NUnit.Runners -Version 3.6.1 -OutputDirectory testrunner
'''
}
}
}
def buildDriver() {
if (env.OS_VERSION.split('/')[0] == 'win') {
powershell label: "Install required packages and build the driver for ${env.DOTNET_VERSION}", script: '''
dotnet restore src
dotnet restore src
'''
} else {
if (env.DOTNET_VERSION == 'mono') {
sh label: 'Build the driver for mono', script: '''#!/bin/bash -le
export BuildMonoOnly=True
export RunCodeAnalyzers=False
export MSBuildSDKsPath=/opt/dotnet/sdk/$(dotnet --version)/Sdks
msbuild /t:restore /v:m src/Cassandra.sln
msbuild /p:Configuration=Release /v:m /p:DynamicConstants=LINUX src/Cassandra.sln || true
msbuild /p:Configuration=Release /v:m /p:DynamicConstants=LINUX src/Cassandra.sln
'''
} else {
sh label: "Work around nuget issue", script: '''#!/bin/bash -le
mkdir -p /tmp/NuGetScratch
chmod -R ugo+rwx /tmp/NuGetScratch
'''
sh label: "Install required packages and build the driver for ${env.DOTNET_VERSION}", script: '''#!/bin/bash -le
dotnet restore src || true
dotnet restore src
'''
}
}
}
def executeTests(perCommitSchedule) {
if (perCommitSchedule) {
env.DOTNET_TEST_FILTER = "(TestCategory!=long)&(TestCategory!=memory)&(TestCategory!=realclusterlong)"
env.MONO_TEST_FILTER = "cat != long && cat != memory && cat != realclusterlong"
} else {
env.DOTNET_TEST_FILTER = "(TestCategory!=long)&(TestCategory!=memory)"
env.MONO_TEST_FILTER = "cat != long && cat != memory"
}
if (env.OS_VERSION.split('/')[0] == 'win') {
catchError {
powershell label: "Execute tests for ${env.DOTNET_VERSION}", script: '''
. $env:HOME\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1
. $Env:HOME\\driver-environment.ps1
dotnet test src/Cassandra.IntegrationTests/Cassandra.IntegrationTests.csproj -v n -f $Env:DOTNET_VERSION -c Release --filter $Env:DOTNET_TEST_FILTER --logger "xunit;LogFilePath=../../TestResult_xunit.xml" -- RunConfiguration.TargetPlatform=x64
'''
}
powershell label: 'Convert the test results using saxon', script: '''
java -jar saxon/saxon9he.jar -o:TestResult.xml TestResult_xunit.xml tools/JUnitXml.xslt
'''
} else {
if (env.DOTNET_VERSION == 'mono') {
catchError {
sh label: 'Execute tests for mono', script: '''#!/bin/bash -le
# Load CCM and driver configuration environment variables
set -o allexport
. ${HOME}/environment.txt
set +o allexport
mono ./testrunner/NUnit.ConsoleRunner.3.6.1/tools/nunit3-console.exe src/Cassandra.IntegrationTests/bin/Release/net462/Cassandra.IntegrationTests.dll --where "$MONO_TEST_FILTER" --labels=All --result:"TestResult_nunit.xml"
'''
}
sh label: 'Convert the test results using saxon', script: '''#!/bin/bash -le
java -jar saxon/saxon9he.jar -o:TestResult.xml TestResult_nunit.xml tools/nunit3-junit.xslt
'''
} else {
catchError {
sh label: "Execute tests for ${env.DOTNET_VERSION}", script: '''#!/bin/bash -le
# Load CCM and driver configuration environment variables
set -o allexport
. ${HOME}/environment.txt
set +o allexport
dotnet test src/Cassandra.IntegrationTests/Cassandra.IntegrationTests.csproj -v n -f ${DOTNET_VERSION} -c Release --filter $DOTNET_TEST_FILTER --logger "xunit;LogFilePath=../../TestResult_xunit.xml"
'''
}
sh label: 'Convert the test results using saxon', script: '''#!/bin/bash -le
java -jar saxon/saxon9he.jar -o:TestResult.xml TestResult_xunit.xml tools/JUnitXml.xslt
'''
}
}
}
def notifySlack(status = 'started') {
// Set the global pipeline scoped environment (this is above each matrix)
env.BUILD_STATED_SLACK_NOTIFIED = 'true'
def osVersionDescription = 'Ubuntu'
if (params.CI_SCHEDULE_OS_VERSION == 'win/cs') {
osVersionDescription = 'Windows'
}
def buildType = 'Per-Commit'
def changeLogMsg = getFirstChangeLogEntry()
if (params.CI_SCHEDULE != 'DEFAULT-PER-COMMIT') {
buildType = "${params.CI_SCHEDULE.toLowerCase().capitalize()}-${osVersionDescription}"
}
def color = 'good' // Green
if (status.equalsIgnoreCase('aborted')) {
color = '#808080' // Grey
} else if (status.equalsIgnoreCase('unstable')) {
color = 'warning' // Orange
} else if (status.equalsIgnoreCase('failed')) {
color = 'danger' // Red
} else if (status.equalsIgnoreCase("started")) {
color = '#fde93f' // Yellow
}
def message = """<${env.RUN_DISPLAY_URL}|Build ${env.DRIVER_DISPLAY_NAME} #${env.BUILD_NUMBER} - ${buildType}> ${status}
Commit <${env.GITHUB_COMMIT_URL}|${env.GIT_SHA}> on branch <${env.GITHUB_BRANCH_URL}|${env.BRANCH_NAME}>"""
if (!changeLogMsg.equalsIgnoreCase("")) {
message += """: _${changeLogMsg}_"""
}
if (!status.equalsIgnoreCase('Started')) {
message += """
${status} after ${currentBuild.durationString - ' and counting'}"""
}
slackSend color: "${color}",
channel: "#csharp-driver-dev-bots",
message: "${message}"
}
def submitCIMetrics(buildType) {
long durationMs = currentBuild.duration
long durationSec = durationMs / 1000
long nowSec = (currentBuild.startTimeInMillis + durationMs) / 1000
def branchNameNoPeriods = env.BRANCH_NAME.replaceAll('\\.', '_')
def durationMetric = "okr.ci.csharp.${env.DRIVER_METRIC_TYPE}.${buildType}.${branchNameNoPeriods} ${durationSec} ${nowSec}"
timeout(time: 1, unit: 'MINUTES') {
withCredentials([string(credentialsId: 'lab-grafana-address', variable: 'LAB_GRAFANA_ADDRESS'),
string(credentialsId: 'lab-grafana-port', variable: 'LAB_GRAFANA_PORT')]) {
withEnv(["DURATION_METRIC=${durationMetric}"]) {
sh label: 'Send runtime metrics to labgrafana', script: '''#!/bin/bash -le
echo "${DURATION_METRIC}" | nc -q 5 ${LAB_GRAFANA_ADDRESS} ${LAB_GRAFANA_PORT}
'''
}
}
}
}
@NonCPS
def getChangeLog() {
def log = ""
def changeLogSets = currentBuild.changeSets
for (int i = 0; i < changeLogSets.size(); i++) {
def entries = changeLogSets[i].items
for (int j = 0; j < entries.length; j++) {
def entry = entries[j]
log += " * ${entry.msg} by ${entry.author} <br>"
}
}
return log;
}
@NonCPS
def getFirstChangeLogEntry() {
def changeLogSets = currentBuild.changeSets
def changeLogSetsSize = changeLogSets.size()
if (changeLogSets.size() > 0) {
def firstChangeLogSet = changeLogSets[changeLogSets.size() - 1]
def entries = firstChangeLogSet.items;
if (entries.length > 0) {
return entries[entries.length - 1].msg;
}
}
return "";
}
def describePerCommitStage() {
script {
currentBuild.displayName = "#${env.BUILD_NUMBER} - Per-Commit (${env.GIT_SHA})"
currentBuild.description = "Changelog:<br>${getChangeLog()}".take(250)
}
}
def describeScheduledTestingStage() {
script {
def type = params.CI_SCHEDULE.toLowerCase().capitalize()
def serverVersionDescription = "almost all server version(s) in the matrix"
def osVersionDescription = 'Ubuntu 18.04 LTS'
if (env.OS_VERSION == 'win/cs') {
osVersionDescription = 'Windows 10'
}
currentBuild.displayName = "#${env.BUILD_NUMBER} - ${type} (${osVersionDescription})"
currentBuild.description = "${type} scheduled testing for ${serverVersionDescription} on ${osVersionDescription}"
}
}
// branch pattern for cron
def branchPatternCron = ~"(master)"
pipeline {
agent none
// Global pipeline timeout
options {
disableConcurrentBuilds()
timeout(time: 10, unit: 'HOURS')
buildDiscarder(logRotator(artifactNumToKeepStr: '10', // Keep only the last 10 artifacts
numToKeepStr: '50')) // Keep only the last 50 build records
}
parameters {
choice(
name: 'CI_SCHEDULE',
choices: ['DEFAULT-PER-COMMIT', 'NIGHTLY', 'WEEKLY'],
description: '''<table style="width:100%">
<col width="20%">
<col width="80%">
<tr>
<th align="left">Choice</th>
<th align="left">Description</th>
</tr>
<tr>
<td><strong>ubuntu/bionic64/csharp-driver</strong></td>
<td>Ubuntu 18.04 LTS x86_64</td>
</tr>
<tr>
<td><strong>win/cs</strong></td>
<td>Windows 10</td>
</tr>
</table>''')
choice(
name: 'CI_SCHEDULE_OS_VERSION',
choices: ['DEFAULT-PER-COMMIT', 'ubuntu/bionic64/csharp-driver', 'win/cs'],
description: 'CI testing operating system version to utilize')
}
triggers {
parameterizedCron(branchPatternCron.matcher(env.BRANCH_NAME).matches() ? """
# Every weeknight (Monday - Friday) around 20:00 and 22:00 Pacific / 05:00 and 07:00 Central Europe
H 22 * * 1-5 %CI_SCHEDULE=NIGHTLY;CI_SCHEDULE_OS_VERSION=ubuntu/bionic64/csharp-driver
H 20 * * 1-5 %CI_SCHEDULE=NIGHTLY;CI_SCHEDULE_OS_VERSION=win/cs
# Every Saturday around 01:00 and 05:00 Pacific / 10:00 and 14:00 Central Europe
H 5 * * 6 %CI_SCHEDULE=WEEKLY;CI_SCHEDULE_OS_VERSION=ubuntu/bionic64/csharp-driver
H 1 * * 6 %CI_SCHEDULE=WEEKLY;CI_SCHEDULE_OS_VERSION=win/cs
""" : "")
}
environment {
DOTNET_CLI_TELEMETRY_OPTOUT = '1'
SERVER_VERSION_SNI = 'dse-6.7'
SERVER_VERSION_SNI_WINDOWS = '3.11'
SIMULACRON_PATH = '/home/jenkins/simulacron.jar'
SIMULACRON_PATH_WINDOWS = 'C:\\Users\\Admin\\simulacron.jar'
CCM_ENVIRONMENT_SHELL = '/usr/local/bin/ccm_environment.sh'
CCM_ENVIRONMENT_SHELL_WINDOWS = '/mnt/c/Users/Admin/ccm_environment.sh'
BuildAllTargets = 'True'
RunCodeAnalyzers = 'True'
}
stages {
stage('Per-Commit') {
when {
beforeAgent true
allOf {
expression { params.CI_SCHEDULE == 'DEFAULT-PER-COMMIT' }
not { buildingTag() }
}
}
environment {
OS_VERSION = 'ubuntu/bionic64/csharp-driver'
}
matrix {
axes {
axis {
name 'SERVER_VERSION'
values '2.2', // latest 2.2.x Apache Cassandra�
'3.0', // latest 3.0.x Apache Cassandra�
'3.11', // latest 3.11.x Apache Cassandra�
'4.0', // Development Apache Cassandra�
'dse-5.1', // latest 5.1.x DataStax Enterprise
'dse-6.7', // latest 6.7.x DataStax Enterprise
'dse-6.8' // 6.8 current DataStax Enterprise
}
axis {
name 'DOTNET_VERSION'
values 'mono', 'netcoreapp3.1'
}
}
excludes {
exclude {
axis {
name 'DOTNET_VERSION'
values 'mono'
}
axis {
name 'SERVER_VERSION'
values '2.2', '3.0', 'dse-5.1', 'dse-6.8'
}
}
}
agent {
label "${OS_VERSION}"
}
stages {
stage('Initialize-Environment') {
steps {
initializeEnvironment()
script {
if (env.BUILD_STATED_SLACK_NOTIFIED != 'true') {
notifySlack()
}
}
}
}
stage('Describe-Build') {
steps {
describePerCommitStage()
}
}
stage('Install-Dependencies') {
steps {
installDependencies()
}
}
stage('Build-Driver') {
steps {
buildDriver()
}
}
stage('Execute-Tests') {
steps {
executeTests(true)
}
post {
always {
junit testResults: '**/TestResult.xml'
}
}
}
}
}
post {
always {
node('master') {
submitCIMetrics('commit')
}
}
aborted {
notifySlack('aborted')
}
success {
notifySlack('completed')
}
unstable {
notifySlack('unstable')
}
failure {
notifySlack('FAILED')
}
}
}
stage('Nightly-Ubuntu') {
when {
beforeAgent true
allOf {
expression { params.CI_SCHEDULE == 'NIGHTLY' }
expression { params.CI_SCHEDULE_OS_VERSION == 'ubuntu/bionic64/csharp-driver' }
not { buildingTag() }
}
}
environment {
OS_VERSION = "${params.CI_SCHEDULE_OS_VERSION}"
}
// ##
// # Building on Linux
// # - Do not build using net452 and net461
// # - Target all Apache Cassandra� and DataStax Enterprise versions for netcoreapp2.1
// ##
// H 0 * * 1-5 %CI_SCHEDULE=NIGHTLY;CI_SCHEDULE_DOTNET_VERSION=ALL;CI_SCHEDULE_SERVER_VERSION=2.2 3.11 dse-5.1 dse-6.7;CI_SCHEDULE_OS_VERSION=ubuntu/bionic64/csharp-driver
// H 1 * * 1-5 %CI_SCHEDULE=NIGHTLY;CI_SCHEDULE_DOTNET_VERSION=netcoreapp2.1;CI_SCHEDULE_SERVER_VERSION=ALL;CI_SCHEDULE_OS_VERSION=ubuntu/bionic64/csharp-driver
matrix {
axes {
axis {
name 'SERVER_VERSION'
values '2.1', // Legacy Apache Cassandra�
'2.2', // Legacy Apache Cassandra�
'3.0', // Previous Apache Cassandra�
'3.11', // Current Apache Cassandra�
'4.0', // Development Apache Cassandra�
'dse-5.1', // Legacy DataStax Enterprise
'dse-6.0', // Previous DataStax Enterprise
'dse-6.7', // Current DataStax Enterprise
'dse-6.8' // Current DataStax Enterprise
}
axis {
name 'DOTNET_VERSION'
values 'mono', 'netcoreapp2.1', 'netcoreapp3.1'
}
}
excludes {
exclude {
axis {
name 'DOTNET_VERSION'
values 'mono'
}
axis {
name 'SERVER_VERSION'
values '2.1', '3.0', 'dse-6.0'
}
}
exclude {
axis {
name 'DOTNET_VERSION'
values 'netcoreapp2.1'
}
axis {
name 'SERVER_VERSION'
values '2.1', '2.2', '3.0', 'dse-5.1', 'dse-6.0'
}
}
}
agent {
label "${OS_VERSION}"
}
stages {
stage('Initialize-Environment') {
steps {
initializeEnvironment()
script {
if (env.BUILD_STATED_SLACK_NOTIFIED != 'true') {
notifySlack()
}
}
}
}
stage('Describe-Build') {
steps {
describeScheduledTestingStage()
}
}
stage('Install-Dependencies') {
steps {
installDependencies()
}
}
stage('Build-Driver') {
steps {
buildDriver()
}
}
stage('Execute-Tests') {
steps {
executeTests(false)
}
post {
always {
junit testResults: '**/TestResult.xml'
}
}
}
}
}
post {
aborted {
notifySlack('aborted')
}
success {
notifySlack('completed')
}
unstable {
notifySlack('unstable')
}
failure {
notifySlack('FAILED')
}
}
}
stage('Nightly-Windows') {
when {
beforeAgent true
allOf {
expression { params.CI_SCHEDULE == 'NIGHTLY' }
expression { params.CI_SCHEDULE_OS_VERSION == 'win/cs' }
not { buildingTag() }
}
}
environment {
OS_VERSION = "${params.CI_SCHEDULE_OS_VERSION}"
}
// # Building on Windows
// # - Do not build using mono
// # - Target Apache Cassandra� v3.11.x for netcoreapp2.1
// # - Target Apache Cassandra� v2.1.x, v2.2.x, v3.11.x for net452
// # - Target Apache Cassandra� v2.2.x, v3.11.x for net461
// ##
// H 2 * * 1-5 %CI_SCHEDULE=NIGHTLY;CI_SCHEDULE_DOTNET_VERSION=netcoreapp2.1;CI_SCHEDULE_SERVER_VERSION=3.11;CI_SCHEDULE_OS_VERSION=win/cs
// H 2 * * 1-5 %CI_SCHEDULE=NIGHTLY;CI_SCHEDULE_DOTNET_VERSION=net452;CI_SCHEDULE_SERVER_VERSION=2.1 2.2 3.11;CI_SCHEDULE_OS_VERSION=win/cs
// H 2 * * 1-5 %CI_SCHEDULE=NIGHTLY;CI_SCHEDULE_DOTNET_VERSION=net461;CI_SCHEDULE_SERVER_VERSION=2.2 3.11;CI_SCHEDULE_OS_VERSION=win/cs
matrix {
axes {
axis {
name 'SERVER_VERSION'
values '2.1', // Legacy Apache Cassandra�
'2.2', // Legacy Apache Cassandra�
'3.0', // Previous Apache Cassandra�
'3.11', // Current Apache Cassandra�
'4.0' // Development Apache Cassandra�
}
axis {
name 'DOTNET_VERSION'
values 'netcoreapp2.1', 'netcoreapp3.1', 'net452', 'net462', 'net472', 'net48'
}
}
excludes {
exclude {
axis {
name 'DOTNET_VERSION'
values 'net462'
}
axis {
name 'SERVER_VERSION'
values '2.1'
}
}
exclude {
axis {
name 'DOTNET_VERSION'
values 'netcoreapp3.1'
}
axis {
name 'SERVER_VERSION'
values '2.1', '2.2'
}
}
exclude {
axis {
name 'DOTNET_VERSION'
values 'net472', 'net48'
}
axis {
name 'SERVER_VERSION'
values '2.1', '2.2', '3.0', '4.0'
}
}
exclude {
axis {
name 'DOTNET_VERSION'
values 'net452', 'netcoreapp2.1'
}
axis {
name 'SERVER_VERSION'
values '2.1', '3.0'
}
}
}
agent {
label "${OS_VERSION}"
}
stages {
stage('Initialize-Environment') {
steps {
initializeEnvironment()
script {
if (env.BUILD_STATED_SLACK_NOTIFIED != 'true') {
notifySlack()
}
}
}
}
stage('Describe-Build') {
steps {
describeScheduledTestingStage()
}
}
stage('Install-Dependencies') {
steps {
installDependencies()
}
}
stage('Build-Driver') {
steps {
buildDriver()
}
}
stage('Execute-Tests') {
steps {
executeTests(false)
}
post {
always {
junit testResults: '**/TestResult.xml'
}
}
}
}
}
post {
aborted {
notifySlack('aborted')
}
success {
notifySlack('completed')
}
unstable {
notifySlack('unstable')
}
failure {
notifySlack('FAILED')
}
}
}
stage('Weekly-Ubuntu') {
when {
beforeAgent true
allOf {
expression { params.CI_SCHEDULE == 'WEEKLY' }
expression { params.CI_SCHEDULE_OS_VERSION == 'ubuntu/bionic64/csharp-driver' }
not { buildingTag() }
}
}
environment {
OS_VERSION = "${params.CI_SCHEDULE_OS_VERSION}"
}
matrix {
axes {
axis {
name 'SERVER_VERSION'
values '2.1', // Legacy Apache Cassandra�
'2.2', // Legacy Apache Cassandra�
'3.0', // Previous Apache Cassandra�
'3.11', // Current Apache Cassandra�
'4.0', // Development Apache Cassandra�
'dse-5.1', // Legacy DataStax Enterprise
'dse-6.0', // Previous DataStax Enterprise
'dse-6.7', // Current DataStax Enterprise
'dse-6.8' // Current DataStax Enterprise
}
axis {
name 'DOTNET_VERSION'
values 'mono', 'netcoreapp2.1', 'netcoreapp3.1'
}
}
excludes {
exclude {
axis {
name 'DOTNET_VERSION'
values 'netcoreapp2.1'
}
axis {
name 'SERVER_VERSION'
values '2.1', '3.0', 'dse-6.0'
}
}
}
agent {
label "${OS_VERSION}"
}
stages {
stage('Initialize-Environment') {
steps {
initializeEnvironment()
script {
if (env.BUILD_STATED_SLACK_NOTIFIED != 'true') {
notifySlack()
}
}
}
}
stage('Describe-Build') {
steps {
describeScheduledTestingStage()
}
}
stage('Install-Dependencies') {
steps {
installDependencies()
}
}
stage('Build-Driver') {
steps {
buildDriver()
}
}
stage('Execute-Tests') {
steps {
executeTests(false)
}
post {
always {
junit testResults: '**/TestResult.xml'
}
}
}
}
}
post {
aborted {
notifySlack('aborted')
}
success {
notifySlack('completed')
}
unstable {
notifySlack('unstable')
}
failure {
notifySlack('FAILED')
}
}
}
stage('Weekly-Windows') {
when {
beforeAgent true
allOf {
expression { params.CI_SCHEDULE == 'WEEKLY' }
expression { params.CI_SCHEDULE_OS_VERSION == 'win/cs' }
not { buildingTag() }
}
}
environment {
OS_VERSION = "${params.CI_SCHEDULE_OS_VERSION}"
}
matrix {
axes {
axis {
name 'SERVER_VERSION'
values '2.1', // Legacy Apache Cassandra�
'2.2', // Legacy Apache Cassandra�
'3.0', // Previous Apache Cassandra�
'3.11', // Current Apache Cassandra�
'4.0' // Development Apache Cassandra�
}
axis {
name 'DOTNET_VERSION'
values 'netcoreapp2.1', 'netcoreapp3.1', 'net452', 'net462', 'net472', 'net48'
}
}
excludes {
exclude {
axis {
name 'DOTNET_VERSION'
values 'net452', 'net472', 'net48', 'netcoreapp2.1'
}
axis {
name 'SERVER_VERSION'
values '2.1', '3.0'
}
}
exclude {
axis {
name 'DOTNET_VERSION'
values 'net472', 'net48'
}
axis {
name 'SERVER_VERSION'
values '2.2'
}
}
}
agent {
label "${OS_VERSION}"
}
stages {
stage('Initialize-Environment') {
steps {
initializeEnvironment()
script {
if (env.BUILD_STATED_SLACK_NOTIFIED != 'true') {
notifySlack()
}
}
}
}
stage('Describe-Build') {
steps {
describeScheduledTestingStage()
}
}
stage('Install-Dependencies') {
steps {
installDependencies()
}
}
stage('Build-Driver') {
steps {