2019-10-29 00:46:56 +01:00
|
|
|
// Job definition to test MongoDB connector against different MongoDB versions
|
|
|
|
|
2020-10-12 18:27:17 +02:00
|
|
|
matrixJob('connector-debezium-mongodb-matrix-test') {
|
2019-10-29 00:46:56 +01:00
|
|
|
|
2020-10-12 18:27:17 +02:00
|
|
|
displayName('Debezium MongoDB Connector Test Matrix')
|
2019-10-29 00:46:56 +01:00
|
|
|
description('Executes tests for MongoDB Connector with MongoDB matrix')
|
|
|
|
label('Slave')
|
|
|
|
|
|
|
|
axes {
|
2022-04-08 14:53:45 +02:00
|
|
|
text('MONGODB_VERSION', '4.0', '4.2', '4.4', '5.0')
|
2020-10-12 10:19:55 +02:00
|
|
|
label("Node", "Slave")
|
2021-11-19 10:45:35 +01:00
|
|
|
|
2019-10-29 00:46:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
properties {
|
|
|
|
githubProjectUrl('https://github.com/debezium/debezium')
|
|
|
|
}
|
|
|
|
|
|
|
|
parameters {
|
|
|
|
stringParam('REPOSITORY', 'https://github.com/debezium/debezium', 'Repository from which Debezium is built')
|
2021-10-27 14:16:10 +02:00
|
|
|
stringParam('BRANCH', 'main', 'A branch/tag from which Debezium is built')
|
2019-12-10 15:08:40 +01:00
|
|
|
stringParam('SOURCE_URL', "", "URL to productised sources")
|
|
|
|
booleanParam('PRODUCT_BUILD', false, 'Is this a productised build?')
|
2019-10-29 00:46:56 +01:00
|
|
|
}
|
|
|
|
triggers {
|
2021-12-16 09:47:08 +01:00
|
|
|
cron('H 04 * * *')
|
2019-10-29 00:46:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
wrappers {
|
2019-12-10 15:08:40 +01:00
|
|
|
preBuildCleanup()
|
|
|
|
|
2019-10-29 00:46:56 +01:00
|
|
|
timeout {
|
|
|
|
noActivity(1200)
|
|
|
|
}
|
2022-10-11 12:52:46 +02:00
|
|
|
credentialsBinding {
|
|
|
|
usernamePassword('QUAY_USERNAME', 'QUAY_PASSWORD', 'rh-integration-quay-creds')
|
|
|
|
string('RP_TOKEN', 'report-portal-token')
|
|
|
|
}
|
2019-10-29 00:46:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
publishers {
|
2022-10-11 12:52:46 +02:00
|
|
|
archiveArtifacts {
|
2022-12-06 09:48:29 +01:00
|
|
|
pattern('**/archive.tar.gz')
|
2022-10-11 12:52:46 +02:00
|
|
|
}
|
2019-10-29 00:46:56 +01:00
|
|
|
archiveJunit('**/target/surefire-reports/*.xml')
|
|
|
|
archiveJunit('**/target/failsafe-reports/*.xml')
|
2022-07-19 13:54:41 +02:00
|
|
|
mailer('debezium-qe@redhat.com', false, true)
|
2019-10-29 00:46:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
logRotator {
|
|
|
|
daysToKeep(7)
|
2022-12-06 09:48:29 +01:00
|
|
|
numToKeep(5)
|
2019-10-29 00:46:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
steps {
|
2019-12-10 15:08:40 +01:00
|
|
|
shell('''
|
|
|
|
# Ensure WS cleaup
|
|
|
|
ls -A1 | xargs rm -rf
|
|
|
|
|
|
|
|
# Retrieve sources
|
|
|
|
if [ "$PRODUCT_BUILD" == true ] ; then
|
2021-11-20 21:40:55 +01:00
|
|
|
export MAVEN_OPTS="-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true"
|
2021-11-18 14:34:17 +01:00
|
|
|
PROFILE_PROD="-Ppnc"
|
2019-12-10 15:08:40 +01:00
|
|
|
curl -OJs $SOURCE_URL && unzip debezium-*-src.zip
|
2021-11-18 14:34:17 +01:00
|
|
|
pushd debezium-*-src
|
|
|
|
pushd $(ls | grep -P 'debezium-[^-]+.Final')
|
2022-10-11 12:52:46 +02:00
|
|
|
ATTRIBUTES="downstream mongoDB $MONGODB_VERSION"
|
2019-12-10 15:08:40 +01:00
|
|
|
else
|
|
|
|
git clone $REPOSITORY .
|
|
|
|
git checkout $BRANCH
|
2022-10-11 12:52:46 +02:00
|
|
|
ATTRIBUTES="upstream mongoDB $MONGODB_VERSION"
|
2019-12-10 15:08:40 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Run maven build
|
2022-04-21 08:02:03 +02:00
|
|
|
mvn clean install -U -s $HOME/.m2/settings-snapshots.xml -pl debezium-bom,debezium-connector-mongodb -am -fae \
|
2019-12-10 15:08:40 +01:00
|
|
|
-Dmaven.test.failure.ignore=true \
|
|
|
|
-Dversion.mongo.server=$MONGODB_VERSION \
|
2020-03-17 00:47:43 +01:00
|
|
|
-Dinsecure.repositories=WARN \
|
2022-12-16 11:54:12 +01:00
|
|
|
-Dmongodb.replica.size=3 \
|
2022-11-25 16:56:53 +01:00
|
|
|
-Papicurio \
|
2022-10-11 12:52:46 +02:00
|
|
|
$PROFILE_PROD
|
|
|
|
|
|
|
|
|
|
|
|
RESULTS_FOLDER=final-results
|
|
|
|
RESULTS_PATH=$RESULTS_FOLDER/results
|
|
|
|
|
|
|
|
mkdir -p $RESULTS_PATH
|
|
|
|
cp **/target/surefire-reports/*.xml $RESULTS_PATH
|
|
|
|
cp **/target/failsafe-reports/*.xml $RESULTS_PATH
|
|
|
|
rm -rf $RESULTS_PATH/failsafe-summary.xml
|
2022-12-06 09:48:29 +01:00
|
|
|
tar czf archive.tar.gz $RESULTS_PATH
|
2022-10-11 12:52:46 +02:00
|
|
|
|
|
|
|
docker login quay.io -u "$QUAY_USERNAME" -p "$QUAY_PASSWORD"
|
|
|
|
|
|
|
|
./jenkins-jobs/scripts/report.sh --connector true --env-file env-file.env --results-folder $RESULTS_FOLDER --attributes "$ATTRIBUTES"
|
2019-12-10 15:08:40 +01:00
|
|
|
''')
|
2019-10-29 00:46:56 +01:00
|
|
|
}
|
|
|
|
}
|