Skip to content

Commit e1e88ec

Browse files
committed
skip building tests
1 parent 8fc7797 commit e1e88ec

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

hbase/Dockerfile

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,25 @@ cd "$(/stackable/patchable --images-repo-root=src checkout hbase ${PRODUCT})"
4646

4747
# The release scripts of HBase also run the build twice (three times in fact, once again to build the site which we skip here).
4848
# I chose to replicate that exact behavior for consistency so please don't merge the two mvn runs into one unless you really know what you're doing!
49-
mvn --batch-mode --no-transfer-progress -Dhadoop.profile=3.0 -Dhadoop-three.version=${HADOOP} clean install -DskipTests
50-
mvn --batch-mode --no-transfer-progress -Dhadoop.profile=3.0 -Dhadoop-three.version=${HADOOP} install assembly:single -DskipTests -Dcheckstyle.skip=true -Prelease
49+
# Cannot skip building tests here because the assembly plugin needs a shell script from the test directory.
50+
mvn \
51+
--batch-mode \
52+
--no-transfer-progress \
53+
-Dhadoop.profile=3.0 \
54+
-Dhadoop-three.version=${HADOOP} \
55+
-DskipTests \
56+
clean install
57+
58+
mvn \
59+
--batch-mode \
60+
--no-transfer-progress \
61+
-Dhadoop.profile=3.0 \
62+
-Dhadoop-three.version=${HADOOP} \
63+
-DskipTests \
64+
-Dcheckstyle.skip=true \
65+
-Prelease \
66+
install assembly:single
67+
5168
tar -xzf hbase-assembly/target/hbase-${PRODUCT}-bin.tar.gz -C /stackable/
5269
mv hbase-assembly/target/bom.json /stackable/hbase-${PRODUCT}/hbase-${PRODUCT}.cdx.json
5370

@@ -81,14 +98,17 @@ EOF
8198

8299
FROM stackable/image/java-devel AS opa-authorizer-builder
83100

101+
ARG PRODUCT
84102
ARG OPA_AUTHORIZER
85103
ARG DELETE_CACHES
86104
ARG STACKABLE_USER_UID
87105

88106
USER ${STACKABLE_USER_UID}
89107
WORKDIR /stackable
90108

91-
RUN --mount=type=cache,id=maven-opa,uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
109+
# Use the product version as cache id "maven-opa-${PRODUCT}" to avoid the "rm -rf" problem described above.
110+
# Using the OPA_AUTHORIZER arg is not unique if the same version is used for multiple products.
111+
RUN --mount=type=cache,id=maven-opa-${PRODUCT},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
92112
###
93113
### OPA Authorizer (only for 2.6 upwards)
94114
###
@@ -97,9 +117,10 @@ if [[ -n "$OPA_AUTHORIZER" ]]; then
97117
mvn \
98118
--batch-mode \
99119
--no-transfer-progress \
100-
package \
101120
-DskipTests \
102-
-fhbase-opa-authorizer
121+
-Dmaven.test.skip=true \
122+
-fhbase-opa-authorizer \
123+
package
103124
else
104125
# Create a dummy jar to avoid errors when copying it the final image
105126
mkdir -p hbase-opa-authorizer/target
@@ -238,7 +259,7 @@ COPY --chown=${STACKABLE_USER_UID}:0 hbase/phoenix/stackable/patches/${PHOENIX}
238259
USER ${STACKABLE_USER_UID}
239260
WORKDIR /stackable
240261

241-
RUN --mount=type=cache,id=maven-phoenix-${PHOENIX},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
262+
RUN --mount=type=cache,id=maven-phoenix-${PHOENIX}-${PRODUCT},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
242263
cd "$(/stackable/patchable --images-repo-root=src checkout phoenix ${PHOENIX})"
243264

244265
# The Maven command can be found inside of the scripts in the create-release folder (release-util.sh as of Phoenix 5.2.0)
@@ -250,6 +271,7 @@ mvn \
250271
-Dhbase.profile=${HBASE_PROFILE} \
251272
-Dhadoop.version=${HADOOP} \
252273
-DskipTests \
274+
-Dmaven.test.skip=true \
253275
-Dcheckstyle.skip=true \
254276
clean \
255277
package

0 commit comments

Comments
 (0)