Check for make failure

This commit is contained in:
Bob Mottram 2015-11-24 09:37:53 +00:00
parent 4789e66625
commit a8bd4680e8
1 changed files with 7 additions and 1 deletions

View File

@ -196,6 +196,12 @@ make $IMAGE_TYPE \
SSH_PUBKEY="$SSH_PUBKEY" \
GENERIC_IMAGE="$GENERIC_IMAGE"
if [ ! "$?" = "0" ]; then
echo 'Build failed'
rm -rf $BUILD_DIR
exit 1
fi
EXPECTED_EXTENSION='img'
if [[ $IMAGE_TYPE == "qemu"* ]]; then
EXPECTED_EXTENSION='qcow2'
@ -209,7 +215,7 @@ imgfiles=(build/${PROJECT_NAME}*.${EXPECTED_EXTENSION})
if [ ${#imgfiles[@]} -eq 0 ]; then
echo 'Image was not created'
rm -rf $BUILD_DIR
exit 1
exit 2
fi
mv build/${PROJECT_NAME}*.bz2 ${CURR_DIR}