Skip to content

Commit e0010fc

Browse files
committed
Fix CAMEL_VERSION and QUARKUS_VERSION logic
1 parent c28ab06 commit e0010fc

2 files changed

Lines changed: 66 additions & 10 deletions

File tree

product/README.adoc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,24 +136,19 @@ Basic usage:
136136

137137
[source,shell]
138138
----
139-
export MRRC_LOCAL="/Users/<username>/Downloads/rh-quarkus-platform-3.33.2.SP1-maven-repository/maven-repository" # path to unzipped MRRC ZIP
139+
export MRRC_LOCAL_REPO="/Users/<username>/Downloads/rh-quarkus-platform-3.33.2.SP1-maven-repository/maven-repository" # path to unzipped MRRC ZIP
140140
141141
export QUARKUS_PLATFORM_VERSION="3.33.2.SP1-redhat-00001"
142-
export CAMEL_QUARKUS_VERSION="3.33.0.redhat-00008"
143-
export QUARKUS_VERSION="3.33.2.redhat-00004"
144-
export CAMEL_VERSION="4.18.1.redhat-00026"
145142
146143
"./camel-quarkus-testing.sh" \
147144
--camel-quarkus-dir ".." \
148-
--mrrc-local "${MRRC_LOCAL}" \
145+
--mrrc-local "${MRRC_LOCAL_REPO}" \
149146
--quarkus-platform-group-id com.redhat.quarkus.platform \
150147
--quarkus-platform-artifact-id quarkus-bom \
151148
--quarkus-platform-version "${QUARKUS_PLATFORM_VERSION}" \
152149
--camel-quarkus-platform-group-id com.redhat.quarkus.platform \
153150
--camel-quarkus-platform-artifact-id quarkus-camel-bom \
154151
--camel-quarkus-platform-version "${QUARKUS_PLATFORM_VERSION}" \
155-
--quarkus-version "${QUARKUS_VERSION}" \
156-
--camel-version "${CAMEL_VERSION}" \
157152
--run-against-mrrc-only \
158153
--test-modules "integration-tests/docling" \
159154
--verbose

product/camel-quarkus-testing.sh

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,18 +255,41 @@ log "CAMEL_QUARKUS_PLATFORM_ARTIFACT_ID = $CAMEL_QUARKUS_PLATFORM_ARTIFACT_ID"
255255
CAMEL_QUARKUS_PLATFORM_VERSION="${CAMEL_QUARKUS_PLATFORM_VERSION:-$QUARKUS_PLATFORM_VERSION}"
256256
log "CAMEL_QUARKUS_PLATFORM_VERSION = $CAMEL_QUARKUS_PLATFORM_VERSION"
257257

258-
if [[ -z "$QUARKUS_VERSION" && -n "$MRRC_LOCAL" ]]; then
258+
if [[ -z "$QUARKUS_VERSION" && -n "$MRRC_LOCAL" && "$RUN_AGAINST_MRRC_ONLY" == "true" ]]; then
259259
QUARKUS_VERSION="$(ls "${MRRC_LOCAL}/io/quarkus/quarkus-core/" 2>/dev/null | head -1)"
260260
log "QUARKUS_VERSION derived from MRRC_LOCAL"
261261
fi
262262
log "QUARKUS_VERSION = $QUARKUS_VERSION"
263263

264-
if [[ -z "$CAMEL_VERSION" && -n "$MRRC_LOCAL" ]]; then
264+
# Validate that QUARKUS_VERSION is set when RUN_AGAINST_MRRC_ONLY is enabled
265+
if [[ "$RUN_AGAINST_MRRC_ONLY" == "true" && -z "$QUARKUS_VERSION" ]]; then
266+
echo "Error: When --run-against-mrrc-only is set, QUARKUS_VERSION must be specified either via:"
267+
echo " 1. --quarkus-version parameter, or"
268+
echo " 2. --mrrc-local (QUARKUS_VERSION will be derived from MRRC)"
269+
exit 1
270+
fi
271+
272+
# Validate that CAMEL_QUARKUS_VERSION is set when RUN_AGAINST_MRRC_ONLY is NOT enabled
273+
if [[ "$RUN_AGAINST_MRRC_ONLY" != "true" && "$UPSTREAM" != "true" && -z "$CAMEL_QUARKUS_VERSION" ]]; then
274+
echo "Error: When --run-against-mrrc-only is NOT set, CAMEL_QUARKUS_VERSION must be specified via:"
275+
echo " --camel-quarkus-version parameter"
276+
exit 1
277+
fi
278+
279+
if [[ -z "$CAMEL_VERSION" && -n "$MRRC_LOCAL" && "$RUN_AGAINST_MRRC_ONLY" == "true" ]]; then
265280
CAMEL_VERSION="$(ls "${MRRC_LOCAL}/org/apache/camel/camel-direct/" 2>/dev/null | head -1)"
266281
log "CAMEL_VERSION derived from MRRC_LOCAL"
267282
fi
268283
log "CAMEL_VERSION = $CAMEL_VERSION"
269284

285+
# Validate that CAMEL_VERSION is set when RUN_AGAINST_MRRC_ONLY is enabled
286+
if [[ "$RUN_AGAINST_MRRC_ONLY" == "true" && -z "$CAMEL_VERSION" ]]; then
287+
echo "Error: When --run-against-mrrc-only is set, CAMEL_VERSION must be specified either via:"
288+
echo " 1. --camel-version parameter, or"
289+
echo " 2. --mrrc-local (CAMEL_VERSION will be derived from MRRC)"
290+
exit 1
291+
fi
292+
270293
# Build common Maven arguments
271294
COMMON_MVN_ARGS="-B -ntp -Dformatter.skip -Dimpsort.skip -Denforcer.skip -DbuildMetaData.skip -Dcq.camel-prod-excludes.skip=true -Dcamel-quarkus.update-extension-doc-page.skip -Djava.home=$JAVA_HOME"
272295

@@ -310,7 +333,7 @@ if [[ "$TEST_ONLY" != "true" ]]; then
310333
# Hack to fix the missing Jetty BOM (CEQ-8802)
311334
if [[ -f "poms/bom/src/main/generated/flattened-reduced-pom.xml" ]]; then
312335
log "Copying flattened-reduced-pom.xml to poms/bom/pom.xml"
313-
cp poms/bom/src/main/generated/flattened-reduced-pom.xml poms/bom/pom.xml
336+
cp poms/bom/src/main/generated/flattened-reduced-pom.xml poms/bom/pom.xml || exit $?
314337
fi
315338

316339
# Replace Camel version in the top pom.xml
@@ -321,10 +344,43 @@ cd /*[local-name()="project"]/*[local-name()="parent"]/*[local-name()="version"]
321344
set $CAMEL_VERSION
322345
save
323346
EOF
347+
if [[ $? -ne 0 ]]; then
348+
echo "Error: Failed to replace Camel parent version in pom.xml"
349+
exit 1
350+
fi
351+
324352
xmllint --shell pom.xml <<EOF
325353
cd /*[local-name()="project"]/*[local-name()="properties"]/*[local-name()="camel.version"]
326354
set $CAMEL_VERSION
327355
save
356+
EOF
357+
if [[ $? -ne 0 ]]; then
358+
echo "Error: Failed to replace Camel version property in pom.xml"
359+
exit 1
360+
fi
361+
fi
362+
363+
# Replace Quarkus version in the top pom.xml
364+
if [[ -n "$QUARKUS_VERSION" ]]; then
365+
log "Replacing Quarkus version to $QUARKUS_VERSION in pom.xml"
366+
xmllint --shell pom.xml <<EOF
367+
cd /*[local-name()="project"]/*[local-name()="properties"]/*[local-name()="quarkus.version"]
368+
set $QUARKUS_VERSION
369+
save
370+
EOF
371+
if [[ $? -ne 0 ]]; then
372+
echo "Error: Failed to replace Quarkus version property in pom.xml"
373+
exit 1
374+
fi
375+
fi
376+
377+
# Replace Quarkus version in the top pom.xml
378+
if [[ -n "$QUARKUS_VERSION" ]]; then
379+
log "Replacing Quarkus version to $QUARKUS_VERSION in pom.xml"
380+
xmllint --shell pom.xml <<EOF
381+
cd /*[local-name()="project"]/*[local-name()="properties"]/*[local-name()="quarkus.version"]
382+
set $QUARKUS_VERSION
383+
save
328384
EOF
329385
fi
330386
fi
@@ -354,6 +410,11 @@ EOF
354410
$SETTINGS_XML_ARG \
355411
$MVN_EXTRA \
356412
$module
413+
MVN_EXIT_CODE=$?
414+
if [[ $MVN_EXIT_CODE -ne 0 ]]; then
415+
echo "Error: Maven build failed for module $module with exit code $MVN_EXIT_CODE"
416+
exit $MVN_EXIT_CODE
417+
fi
357418
done
358419
fi
359420
fi

0 commit comments

Comments
 (0)