2020-02-20 14:45:48 +01:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
label 'Slave'
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('CleanWorkspace') {
|
|
|
|
steps {
|
|
|
|
cleanWs()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout([
|
|
|
|
$class : 'GitSCM',
|
|
|
|
branches : [[name: "${DBZ_GIT_BRANCH}"]],
|
|
|
|
userRemoteConfigs: [[url: "${DBZ_GIT_REPOSITORY}"]],
|
|
|
|
extensions : [[$class : 'RelativeTargetDirectory',
|
|
|
|
relativeTargetDir: 'debezium']],
|
|
|
|
])
|
|
|
|
|
|
|
|
script {
|
|
|
|
env.STRZ_RESOURCES = "${env.WORKSPACE}/strimzi/install/cluster-operator"
|
|
|
|
}
|
|
|
|
sh '''
|
|
|
|
set -x
|
|
|
|
curl -OJs ${STRZ_RESOURCES_ARCHIVE_URL} && unzip amq-streams-*-install-examples.zip -d strimzi
|
|
|
|
'''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Copy Images & Process Resource') {
|
|
|
|
steps {
|
|
|
|
withCredentials([
|
|
|
|
usernamePassword(credentialsId: "${QUAY_CREDENTIALS}", usernameVariable: 'QUAY_USERNAME', passwordVariable: 'QUAY_PASSWORD'),
|
|
|
|
|
|
|
|
]) {
|
|
|
|
sh '''
|
|
|
|
set -x
|
|
|
|
cd "${WORKSPACE}/debezium"
|
|
|
|
./jenkins-jobs/scripts/copy-images.sh \\
|
|
|
|
--dir="${STRZ_RESOURCES}" \\
|
|
|
|
--images="${STRZ_IMAGES}" \\
|
|
|
|
--registry="quay.io" --organisation="${QUAY_ORGANISATION}" \\
|
2021-09-14 13:16:15 +02:00
|
|
|
--dest-login="${QUAY_USERNAME}" \\
|
|
|
|
--dest-pass="${QUAY_PASSWORD}" \\
|
2020-11-10 13:56:49 +01:00
|
|
|
--deployment-desc="${STRZ_RESOURCES_DEPLOYMENT_DESCRIPTOR}" \\
|
2020-09-19 21:06:24 +02:00
|
|
|
--img-output="${WORKSPACE}/published_images.txt"
|
2020-02-20 14:45:48 +01:00
|
|
|
'''
|
|
|
|
zip(archive: true, zipFile: 'amq-streams-install-examples.zip', dir: 'strimzi')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build Debezium Connect Image') {
|
|
|
|
when {
|
|
|
|
expression { params.DBZ_CONNECT_BUILD }
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
withCredentials([
|
|
|
|
usernamePassword(credentialsId: "${QUAY_CREDENTIALS}", usernameVariable: 'QUAY_USERNAME', passwordVariable: 'QUAY_PASSWORD'),
|
|
|
|
]) {
|
|
|
|
sh '''
|
|
|
|
set -x
|
|
|
|
cd "${WORKSPACE}/debezium"
|
|
|
|
./jenkins-jobs/scripts/build-connect-image.sh \\
|
|
|
|
--dir="${WORKSPACE}" \\
|
|
|
|
--archive-urls="${DBZ_CONNECTOR_ARCHIVE_URLS}" \\
|
2020-09-19 21:06:24 +02:00
|
|
|
--libs="${DBZ_EXTRA_LIBS}" \\
|
2020-02-20 14:45:48 +01:00
|
|
|
--images="${STRZ_IMAGES}" \\
|
|
|
|
--registry="quay.io" --organisation="${QUAY_ORGANISATION}" \\
|
2021-09-14 13:16:15 +02:00
|
|
|
--dest-login="${QUAY_USERNAME}" \\
|
|
|
|
--dest-pass="${QUAY_PASSWORD}" \\
|
2020-09-19 21:06:24 +02:00
|
|
|
--img-output="${WORKSPACE}/published_images_dbz.txt"
|
2020-02-20 14:45:48 +01:00
|
|
|
'''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-04-28 11:55:01 +02:00
|
|
|
|
|
|
|
stage('Create main artefact') {
|
|
|
|
steps {
|
|
|
|
sh '''
|
|
|
|
set -x
|
|
|
|
mkdir "${WORKSPACE}/amq-streams-all"
|
|
|
|
cp -R "${WORKSPACE}/strimzi" "${WORKSPACE}/amq-streams-all/strimzi"
|
|
|
|
cp "${WORKSPACE}/published_images.txt" "${WORKSPACE}/amq-streams-all/amq-streams-published-images.txt"
|
|
|
|
cp "${WORKSPACE}/published_images_dbz.txt" \\
|
|
|
|
"${WORKSPACE}/amq-streams-all/amq-streams-published-images-dbz.txt" || :
|
|
|
|
'''
|
|
|
|
zip(archive: true, zipFile: 'amq-streams-all.zip', dir: 'amq-streams-all')
|
|
|
|
}
|
|
|
|
}
|
2020-02-20 14:45:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
always {
|
2021-10-05 07:20:45 +02:00
|
|
|
mail to: MAIL_TO, subject: "Debezium OpenShift test run #${BUILD_NUMBER} finished", body: """
|
2020-11-11 06:46:47 +01:00
|
|
|
${currentBuild.projectName} run ${BUILD_URL} finished with result: ${currentBuild.currentResult}
|
2020-02-20 14:45:48 +01:00
|
|
|
"""
|
|
|
|
}
|
|
|
|
success {
|
|
|
|
archiveArtifacts "**/published_images*.txt"
|
|
|
|
}
|
|
|
|
}
|
2020-11-11 06:46:47 +01:00
|
|
|
}
|