Skip to content

Commit 1aeaf27

Browse files
dansanduleacrobert3005
authored andcommitted
Faster deploy by parallelizing maven and skipping unnecessary second 'mvn package' (apache-spark-on-k8s#342)
1 parent d531f53 commit 1aeaf27

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

dev/make-distribution.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,17 @@ fi
172172
# Store the command as an array because $MVN variable might have spaces in it.
173173
# Normal quoting tricks don't work.
174174
# See: http://mywiki.wooledge.org/BashFAQ/050
175-
BUILD_COMMAND=("$MVN" -T 1C $MAYBE_CLEAN package -DskipTests $@)
175+
if [[ -z "$DONT_BUILD" ]]; then
176+
BUILD_COMMAND=("$MVN" -T 1C $MAYBE_CLEAN package -DskipTests $@)
176177

177-
# Actually build the jar
178-
echo -e "\nBuilding with..."
179-
echo -e "\$ ${BUILD_COMMAND[@]}\n"
178+
# Actually build the jar
179+
echo -e "\nBuilding with..."
180+
echo -e "\$ ${BUILD_COMMAND[@]}\n"
180181

181-
"${BUILD_COMMAND[@]}"
182+
"${BUILD_COMMAND[@]}"
183+
else
184+
echo -e "\nNot running mvn package because \$DONT_BUILD was set"
185+
fi
182186

183187
# Make directories
184188
rm -rf "$DISTDIR"

dev/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ FWDIR="$(cd "`dirname "${BASH_SOURCE[0]}"`"; pwd)"
77
source "$FWDIR/publish_functions.sh"
88

99
publish_artifacts | tee -a "/tmp/publish_artifacts.log"
10-
make_dist "${PALANTIR_FLAGS[*]}" | tee -a "/tmp/make-dist.log"
10+
DONT_BUILD=true make_dist "${PALANTIR_FLAGS[*]}" | tee -a "/tmp/make-dist.log"

dev/publish_functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ publish_artifacts() {
2121
echo "<password>$BINTRAY_PASSWORD</password>" >> $tmp_settings
2222
echo "</server></servers></settings>" >> $tmp_settings
2323

24-
./build/mvn --settings $tmp_settings -DskipTests "${PALANTIR_FLAGS[@]}" deploy
24+
./build/mvn -T 1C --settings $tmp_settings -DskipTests "${PALANTIR_FLAGS[@]}" deploy
2525
}
2626

2727
make_dist() {

0 commit comments

Comments
 (0)