Skip to content

Commit

Permalink
DBZ-2736 Ability to specify deployment descriptor of Strimzi cluster …
Browse files Browse the repository at this point in the history
…operator in OCP prepare job
jcechace authored and jpechane committed Nov 10, 2020
1 parent 79506d0 commit 9f31016
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions jenkins-jobs/job-dsl/ocp_downstream_strimzi_prepare.groovy
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ pipelineJob('ocp-downstream-strimzi-prepare-job') {
stringParam('QUAY_ORGANISATION', '', "Organisation where images are copied")
// STRIMZI CONFIG
stringParam('STRZ_RESOURCES_ARCHIVE_URL', "", "URL to productised strimzi sources")
stringParam('STRZ_RESOURCES_DEPLOYMENT_DESCRIPTOR', "060-Deployment-strimzi-cluster-operator.yaml", "Descriptor for cluster-operator deployment")
textParam('STRZ_IMAGES', "", "List of productised strimzi images")
// DEBEZIUM CONFIG
stringParam('DBZ_GIT_REPOSITORY', 'https://github.com/debezium/debezium.git', 'Repository from which Debezium sources are cloned')
1 change: 1 addition & 0 deletions jenkins-jobs/pipelines/downstream_prepare_pipeline.groovy
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ pipeline {
--images="${STRZ_IMAGES}" \\
--registry="quay.io" --organisation="${QUAY_ORGANISATION}" \\
--dest-creds="${QUAY_USERNAME}:${QUAY_PASSWORD}" \\
--deployment-desc="${STRZ_RESOURCES_DEPLOYMENT_DESCRIPTOR}" \\
--img-output="${WORKSPACE}/published_images.txt"
'''
zip(archive: true, zipFile: 'amq-streams-install-examples.zip', dir: 'strimzi')
6 changes: 4 additions & 2 deletions jenkins-jobs/scripts/copy-images.sh
Original file line number Diff line number Diff line change
@@ -5,8 +5,9 @@ INSTALL_SOURCE_DIR="${WORKSPACE}/strimzi/install/cluster-operator"
COPY_IMAGES=true
REGISTRY="quay.io"
BUILD_DBZ_DOCKERFILE=${DIR}/../docker/Dockerfile.AMQ
DEPLOYMENT_DESC="060-Deployment-strimzi-cluster-operator.yaml"

OPTS=`getopt -o d:i:r:o:s --long dir:,images:,registry:,organisation:,skip-copy,dest-creds:,src-creds:,img-output: -n 'parse-options' -- "$@"`
OPTS=`getopt -o d:i:r:o:f:s --long dir:,images:,registry:,organisation:,deployment-desc:,skip-copy,dest-creds:,src-creds:,img-output: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
eval set -- "$OPTS"

@@ -16,6 +17,7 @@ while true; do
-i | --images ) IMAGES=$2; shift; shift ;;
-r | --registry ) REGISTRY=$2; shift; shift ;;
-o | --organisation ) ORGANISATION=$2; shift; shift ;;
-f | --deployment-desc ) DEPLOYMENT_DESC=$2; shift; shift ;;
-s | --skip-copy ) COPY_IMAGES=false; shift ;;
--dest-creds ) DEST_CREDS="--dest-creds $2"; shift; shift ;;
--src-creds ) SRC_CREDS="--src-creds $2"; shift; shift ;;
@@ -45,7 +47,7 @@ function process_image() {

# Replace images
echo "[Deployment Transformation] replacing image ${target}"
sed -i "s@registry.redhat.io/.*/${name}:.*\$@${target}@" "${INSTALL_SOURCE_DIR}/050-Deployment-strimzi-cluster-operator.yaml"
sed -i "s@registry.redhat.io/.*/${name}:.*\$@${target}@" "${INSTALL_SOURCE_DIR}/${DEPLOYMENT_DESC}"
}


0 comments on commit 9f31016

Please sign in to comment.