Skip to content

Commit a7553cc

Browse files
SiyaoIsHidingmichaelsembwever
authored andcommitted
Add Jenkinsfile-asf for OSS CI
patch by Siyao (Jane) He; reviewed by Mick Semb Wever for CASSANDRA-19832
1 parent e1f397e commit a7553cc

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

Jenkinsfile-asf

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!groovy
2+
3+
/*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
pipeline {
23+
agent {
24+
label 'cassandra-small'
25+
}
26+
27+
triggers {
28+
// schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.)
29+
cron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? "@weekly" : "")
30+
}
31+
32+
stages {
33+
stage('Matrix') {
34+
matrix {
35+
axes {
36+
axis {
37+
name 'TEST_JAVA_VERSION'
38+
39+
}
40+
axis {
41+
name 'SERVER_VERSION'
42+
values '2.1', '3.0', '3.11', '4.0'
43+
}
44+
}
45+
stages {
46+
stage('Tests') {
47+
agent {
48+
label 'cassandra-medium'
49+
}
50+
steps {
51+
script {
52+
executeTests()
53+
junit testResults: '**/target/surefire-reports/TEST-*.xml', allowEmptyResults: true
54+
junit testResults: '**/target/failsafe-reports/TEST-*.xml', allowEmptyResults: true
55+
}
56+
}
57+
}
58+
}
59+
}
60+
}
61+
}
62+
}
63+
64+
def executeTests() {
65+
sh "docker run -e TEST_JAVA_VERSION=${TEST_JAVA_VERSION} -e SERVER_VERSION=${SERVER_VERSION} -v \$(pwd):/home/docker/cassandra-java-driver apache.jfrog.io/cassan-docker/apache/cassandra-java-driver-testing-ubuntu2204 cassandra-java-driver/ci/run-tests.sh"
66+
}
67+
68+
// branch pattern for cron
69+
// should match 3.x, 4.x, 4.5.x, etc
70+
def branchPatternCron() {
71+
~"((\\d+(\\.[\\dx]+)+))"
72+
}
73+
File renamed without changes.

ci/run-tests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash -x
2+
3+
. ~/env.txt
4+
printenv | sort
5+
cd $(dirname "$(readlink -f "$0")")/..
6+
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
7+
jabba use ${TEST_JAVA_VERSION}
8+
printenv | sort
9+
mvn -B -V verify -T 1 -Dcassandra.version=${SERVER_VERSION} -Ddse=false -Dmaven.test.failure.ignore=true -Dmaven.javadoc.skip=true;

0 commit comments

Comments
 (0)