-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (34 loc) · 2.08 KB
/
Dockerfile
File metadata and controls
46 lines (34 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# syntax=docker/dockerfile:1.20.0@sha256:26147acbda4f14c5add9946e2fd2ed543fc402884fd75146bd342a7f6271dc1d
# check=error=true
FROM local-image/trino/trino AS trino-builder
FROM local-image/java-devel AS storage-connector-builder
ARG PRODUCT_VERSION
ARG RELEASE_VERSION
ARG STACKABLE_USER_UID
WORKDIR /stackable
COPY --chown=${STACKABLE_USER_UID}:0 trino/storage-connector/stackable/patches/patchable.toml /stackable/src/trino-storage-connector/stackable/patches/patchable.toml
COPY --chown=${STACKABLE_USER_UID}:0 trino/storage-connector/stackable/patches/${PRODUCT_VERSION} /stackable/src/trino-storage-connector/stackable/patches/${PRODUCT_VERSION}
COPY --chown=${STACKABLE_USER_UID}:0 --from=trino-builder /stackable/patched-libs /stackable/patched-libs
USER ${STACKABLE_USER_UID}
# adding a hadolint ignore for SC2215, due to https://github.com/hadolint/hadolint/issues/980
# hadolint ignore=SC2215
RUN --mount=type=cache,id=maven-${PRODUCT_VERSION},target=/stackable/.m2/repository,uid=${STACKABLE_USER_UID} <<EOF
cd "$(/stackable/patchable --images-repo-root=src checkout trino-storage-connector ${PRODUCT_VERSION})"
# Make Maven aware of custom Stackable libraries
cp -r /stackable/patched-libs/maven/* /stackable/.m2/repository
ORIGINAL_VERSION="${PRODUCT_VERSION}"
NEW_VERSION="${PRODUCT_VERSION}-stackable${RELEASE_VERSION}"
# Create snapshot of the source code including custom patches
tar -czf /stackable/trino-storage-connector-${NEW_VERSION}-src.tar.gz .
mvn versions:set -DnewVersion=${NEW_VERSION}
mvn \
package \
-DskipTests `# Skip test execution` \
-Ddep.trino.version=${NEW_VERSION} `# Use custom Stackable Trino version in tests` \
-Dcheckstyle.skip `# Skip checkstyle checks. We dont care if the code is properly formatted, it just wastes time` \
-Dmaven.javadoc.skip=true `# Dont generate javadoc` \
-Dmaven.gitcommitid.skip=true `# The gitcommitid plugin cannot work with git workspaces (ie: patchable)`
sed -i "s/${NEW_VERSION}/${ORIGINAL_VERSION}/g" target/bom.json
# Set correct permissions
chmod --recursive g=u target /stackable/trino-storage-connector-${NEW_VERSION}-src.tar.gz
EOF