2019-10-29 00:46:56 +01:00
|
|
|
// Job definition to test PostgreSQL connector against different PostgreSQL versions
|
|
|
|
|
2020-10-12 18:27:17 +02:00
|
|
|
matrixJob('connector-debezium-postgresql-matrix-test') {
|
2019-10-29 00:46:56 +01:00
|
|
|
|
2020-10-12 18:27:17 +02:00
|
|
|
displayName('Debezium PostgreSQL Connector Test Matrix')
|
2019-10-29 00:46:56 +01:00
|
|
|
description('Executes tests for PostgreSQL Connector with PostgreSQL matrix')
|
|
|
|
label('Slave')
|
|
|
|
combinationFilter('''
|
|
|
|
DECODER_PLUGIN == "decoderbufs" ||
|
2019-11-28 13:13:23 +01:00
|
|
|
(DECODER_PLUGIN == "pgoutput" && (POSTGRES_VERSION == "10" || POSTGRES_VERSION == "11")) ||
|
2021-02-04 06:16:02 +01:00
|
|
|
POSTGRES_VERSION == "12" ||
|
2021-10-04 10:24:08 +02:00
|
|
|
POSTGRES_VERSION == "13" ||
|
2022-10-18 08:58:11 +02:00
|
|
|
POSTGRES_VERSION == "14" ||
|
|
|
|
POSTGRES_VERSION == "15"
|
2019-10-29 00:46:56 +01:00
|
|
|
''')
|
|
|
|
|
|
|
|
axes {
|
2022-10-18 08:58:11 +02:00
|
|
|
text('POSTGRES_VERSION', '10', '11', '12', '13', '14', '15')
|
2022-04-06 09:18:56 +02:00
|
|
|
text('DECODER_PLUGIN', 'decoderbufs', 'pgoutput')
|
2020-10-12 10:19:55 +02:00
|
|
|
label("Node", "Slave")
|
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 {
|
2021-11-21 01:18:27 +01:00
|
|
|
noActivity(3600)
|
2019-10-29 00:46:56 +01:00
|
|
|
}
|
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 PostgreSQL $POSTGRES_VERSION $DECODER_PLUGIN"
|
|
|
|
|
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 PostgreSQL $POSTGRES_VERSION $DECODER_PLUGIN"
|
2019-12-10 15:08:40 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Setup pg config for Alpine distributions
|
|
|
|
if [[ $POSTGRES_VERSION =~ alpine$ ]] ; then
|
|
|
|
MAVEN_ARGS = "-Dpostgres.config.file=/usr/local/share/postgresql/postgresql.conf.sample"
|
|
|
|
else
|
|
|
|
MAVEN_ARGS="-Dnone"
|
|
|
|
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-postgres -am -fae \
|
2019-12-10 15:08:40 +01:00
|
|
|
-Dmaven.test.failure.ignore=true \
|
|
|
|
-Dpostgres.port=55432 \
|
|
|
|
-Dversion.postgres.server=$POSTGRES_VERSION \
|
|
|
|
-Ddecoder.plugin.name=$DECODER_PLUGIN \
|
|
|
|
-Dtest.argline="-Ddebezium.test.records.waittime=5" \
|
|
|
|
-Dinsecure.repositories=WARN \
|
2022-11-25 16:56:53 +01:00
|
|
|
-Papicurio \
|
2021-11-18 14:34:17 +01:00
|
|
|
$PROFILE_PROD \
|
2019-12-10 15:08:40 +01:00
|
|
|
$MAVEN_ARGS
|
2022-10-11 12:52:46 +02:00
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|