Skip to content

Commit c4b532d

Browse files
authored
Fix: fail build.sh if archive not produced by createArchive() (#2888)
* fix: fail build.sh if archive not produced by createArchive() Ref: #2261 * Remove misleading debug info. in common function Ref: #2546 (comment)
1 parent 1165bf4 commit c4b532d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

sbin/build.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,10 +1409,19 @@ createArchive() {
14091409
createOpenJDKArchive "${repoLocation}" "OpenJDK"
14101410
archive="${PWD}/OpenJDK${archiveExtension}"
14111411

1412+
archiveTarget=${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[TARGET_DIR]}/${targetName}
1413+
14121414
echo "Your final archive was created at ${archive}"
14131415

14141416
echo "Moving the artifact to ${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[TARGET_DIR]}"
1415-
mv "${archive}" "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[TARGET_DIR]}/${targetName}"
1417+
mv "${archive}" "${archiveTarget}"
1418+
1419+
if [ -f "$archiveTarget" ] && [ -s "$archiveTarget" ] ; then
1420+
echo "archive done."
1421+
else
1422+
echo "[ERROR] ${targetName} failed to be archived"
1423+
exit 1
1424+
fi
14161425
}
14171426

14181427
# Create a Tar ball

sbin/common/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ createOpenJDKArchive()
129129
if which pigz > /dev/null 2>&1; then
130130
COMPRESS=pigz
131131
fi
132-
echo "Archiving the build OpenJDK image and compressing with $COMPRESS"
132+
echo "Archiving and compressing with $COMPRESS"
133133

134134
EXT=$(getArchiveExtension)
135135

0 commit comments

Comments
 (0)