Skip to content

Commit 893af7a

Browse files
committed
fix(trino): Selectively skip projects by version
Also remove the git hack for patchable and instead skip gitcommitid like we do for druid and rearrange the command into multiple lines with additional skips
1 parent 683a028 commit 893af7a

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

trino/Dockerfile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ cd "$(/stackable/patchable --images-repo-root=src checkout trino ${PRODUCT})"
2727
# Create snapshot of the source code including custom patches
2828
tar -czf /stackable/trino-${PRODUCT}-src.tar.gz .
2929

30-
# Trino is using something (git-commit-id-plugin in the past, maybe something else now) that is
31-
# reading the Git history and searches for a tag to pull the version from. It sounds weird to me
32-
# why someone would do that over just picking the version from the pom.xml, but they propably
33-
# have their reasons. See e.g. https://github.com/trinodb/trino/discussions/18963.
34-
# So we fake it till we make it and create a Git repo and the correct tag. The trino-operator
35-
# smoke test checks that "select version()" is working.
36-
# Also, we need to initialize a new Git repo because `git-commit-id-maven-plugin` has a problem with worktrees, see https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/215
37-
rm .git
38-
git init
39-
git config user.email "[email protected]"
40-
git config user.name "Fake commiter"
41-
git commit --allow-empty --message "Fake commit, so that we can create a tag"
42-
git tag ${PRODUCT}
30+
SKIP_PROJECTS="!docs"
31+
if [ "$PRODUCT" = "470" ] || [ "$PRODUCT" = "451" ]; then
32+
SKIP_PROJECTS="$SKIP_PROJECTS,!core/trino-server-rpm"
33+
fi
4334

4435
# We need to use ./mvnw instead of mvn to get a recent maven version (which is required to build Trino)
45-
./mvnw --batch-mode --no-transfer-progress package -DskipTests --projects="!docs,!core/trino-server-rpm"
36+
./mvnw \
37+
--batch-mode \
38+
--no-transfer-progress \
39+
package \
40+
`# -Dmaven.test.skip # Unable to skip test compilation without an unused dependency error for software.amazon.awssdk:identity-spi` \
41+
-DskipTests `# Skip test execution` \
42+
-Dcheckstyle.skip `# Skip checkstyle checks. We dont care if the code is properly formatted, it just wastes time` \
43+
-Dmaven.javadoc.skip=true `# Dont generate javadoc` \
44+
-Dmaven.gitcommitid.skip=true `# The gitcommitid plugin cannot work with git workspaces (ie: patchable)` \
45+
--projects="$SKIP_PROJECTS"
4646

4747
# Delete intermediate build products to free some space and keep runners happy
4848
rm -r plugin/*/target core/trino-server/target/trino-server-${PRODUCT}

trino/storage-connector/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,13 @@ tar -czf /stackable/trino-storage-connector-${PRODUCT}-src.tar.gz .
2323
mvn versions:set -DnewVersion=${PRODUCT}
2424

2525
# We need to use ./mvnw instead of mvn to get a recent maven version (which is required to build Trino)
26-
./mvnw --batch-mode --no-transfer-progress package -DskipTests -Dmaven.gitcommitid.skip=true
26+
./mvnw \
27+
--batch-mode \
28+
--no-transfer-progress \
29+
package \
30+
-Dmaven.test.skip `# Skip test compilation` \
31+
-DskipTests `# Skip test execution` \
32+
-Dcheckstyle.skip `# Skip checkstyle checks. We dont care if the code is properly formatted, it just wastes time` \
33+
-Dmaven.javadoc.skip=true `# Dont generate javadoc` \
34+
-Dmaven.gitcommitid.skip=true `# The gitcommitid plugin cannot work with git workspaces (ie: patchable)`
2735
EOF

0 commit comments

Comments
 (0)