Skip to content

Commit 0cf30ee

Browse files
authored
Reduce dev rebuild times for single profile docker images (#432)
- reduce duplicate calls to `fmt` target - skip file dedup for single profile docker image builds
1 parent 3f5608e commit 0cf30ee

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docker/benchbase/devcontainer/build-in-container.sh

+9-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function build_profile() {
3232
mkdir -p target/$profile
3333
# Build the profile without tests (we did that separately).
3434
mvn -T 2C -B --file pom.xml package -D descriptors=src/main/assembly/dir.xml -P $profile \
35-
$SKIP_TEST_ARGS $EXTRA_MAVEN_ARGS -D buildDirectory=target/$profile
35+
-Dfmt.skip $SKIP_TEST_ARGS $EXTRA_MAVEN_ARGS -D buildDirectory=target/$profile
3636
# Copy the resultant output to the profiles directory.
3737
cp -rlv target/$profile/benchbase-$profile/benchbase-$profile profiles/$profile
3838
# Later the container entrypoint will move into this directory to run it, so
@@ -105,7 +105,7 @@ fi
105105
# Fetch resources serially to work around mvn races with downloading the same
106106
# file in multiple processes (mvn uses *.part instead of use tmpfile naming).
107107
for profile in ${BENCHBASE_PROFILES}; do
108-
mvn -T2C -B --file pom.xml -D buildDirectory=target/$profile $EXTRA_MAVEN_ARGS process-resources dependency:copy-dependencies
108+
mvn -T2C -B --file pom.xml -Dfmt.skip -D buildDirectory=target/$profile $EXTRA_MAVEN_ARGS process-resources dependency:copy-dependencies
109109
done
110110

111111
# Make sure that we've built the base stuff (and test) before we build individual profiles.
@@ -120,7 +120,13 @@ for profile in ${BENCHBASE_PROFILES}; do
120120
done
121121
wait
122122

123-
deduplicate_profile_files
123+
FIRST_BENCHBASE_PROFILE=$(echo "$BENCHBASE_PROFILES" | awk '{ print $1 }')
124+
if [ "$FIRST_BENCHBASE_PROFILE" == "$BENCHBASE_PROFILES" ]; then
125+
echo "INFO: Single profile build: $FIRST_BENCHBASE_PROFILE. Skipping file dedup."
126+
else
127+
echo "INFO: deduplicating files in combo build."
128+
deduplicate_profile_files
129+
fi
124130

125131
for profile in ${BENCHBASE_PROFILES}; do
126132
test_profile_build "$profile" || exit 1

0 commit comments

Comments
 (0)