Skip to content

Commit

Permalink
Add Jenkinsfile-asf for OSS CI
Browse files Browse the repository at this point in the history
 patch by Siyao (Jane) He; reviewed by Mick Semb Wever for CASSANDRA-19832
  • Loading branch information
SiyaoIsHiding authored and michaelsembwever committed Sep 11, 2024
1 parent e1f397e commit a7553cc
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
73 changes: 73 additions & 0 deletions Jenkinsfile-asf
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!groovy

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

pipeline {
agent {
label 'cassandra-small'
}

triggers {
// schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.)
cron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? "@weekly" : "")
}

stages {
stage('Matrix') {
matrix {
axes {
axis {
name 'TEST_JAVA_VERSION'
values '[email protected]', '[email protected]'
}
axis {
name 'SERVER_VERSION'
values '2.1', '3.0', '3.11', '4.0'
}
}
stages {
stage('Tests') {
agent {
label 'cassandra-medium'
}
steps {
script {
executeTests()
junit testResults: '**/target/surefire-reports/TEST-*.xml', allowEmptyResults: true
junit testResults: '**/target/failsafe-reports/TEST-*.xml', allowEmptyResults: true
}
}
}
}
}
}
}
}

def executeTests() {
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"
}

// branch pattern for cron
// should match 3.x, 4.x, 4.5.x, etc
def branchPatternCron() {
~"((\\d+(\\.[\\dx]+)+))"
}

File renamed without changes.
9 changes: 9 additions & 0 deletions ci/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -x

. ~/env.txt
printenv | sort
cd $(dirname "$(readlink -f "$0")")/..
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
jabba use ${TEST_JAVA_VERSION}
printenv | sort
mvn -B -V verify -T 1 -Dcassandra.version=${SERVER_VERSION} -Ddse=false -Dmaven.test.failure.ignore=true -Dmaven.javadoc.skip=true;

0 comments on commit a7553cc

Please sign in to comment.