Add switch to skip image creation if it already exists (#3454)

* Move artefact creation directory into from deboostrap into configuration

This is needed to support function of early checking for artefacts. Useful for CI

* Introduce IMAGE_PRESENT parameter which we can use when creating a lot of images so we don't need to recreate whole CI if one image fails
This commit is contained in:
Igor Pečovnik
2022-02-02 20:54:42 +01:00
committed by GitHub
parent f80117f21c
commit 26cef397c0
3 changed files with 21 additions and 16 deletions

View File

@@ -45,6 +45,22 @@ else
REPO_CONFIG="aptly.conf"
fi
# image artefact destination with or without subfolder
FINALDEST=$DEST/images
if [[ "${MAKE_FOLDERS}" == yes ]]; then
if [[ "$RC" == yes ]]; then
FINALDEST=$DEST/images/"${BOARD}"/RC
elif [[ "$BETA" == yes ]]; then
FINALDEST=$DEST/images/"${BOARD}"/nightly
else
FINALDEST=$DEST/images/"${BOARD}"/archive
fi
install -d ${FINALDEST}
fi
# TODO: fixed name can't be used for parallel image building
ROOT_MAPPER="armbian-root"

View File

@@ -914,21 +914,6 @@ POST_UMOUNT_FINAL_IMAGE
mkdir -p $DESTIMG
mv ${SDCARD}.raw $DESTIMG/${version}.img
FINALDEST=$DEST/images
[[ "${BUILD_ALL}" == yes ]] && MAKE_FOLDERS="yes"
if [[ "${MAKE_FOLDERS}" == yes ]]; then
if [[ "$RC" == yes ]]; then
FINALDEST=$DEST/images/"${BOARD}"/RC
elif [[ "$BETA" == yes ]]; then
FINALDEST=$DEST/images/"${BOARD}"/nightly
else
FINALDEST=$DEST/images/"${BOARD}"/archive
fi
install -d ${FINALDEST}
fi
# custom post_build_image_modify hook to run before fingerprinting and compression
[[ $(type -t post_build_image_modify) == function ]] && display_alert "Custom Hook Detected" "post_build_image_modify" "info" && post_build_image_modify "${DESTIMG}/${version}.img"

View File

@@ -525,7 +525,11 @@ overlayfs_wrapper "cleanup"
[[ -n "${RELEASE}" && "${DESKTOP_ENVIRONMENT}" && ! -f "${DEB_STORAGE}/$RELEASE/${CHOSEN_DESKTOP}_${REVISION}_all.deb" && "${REPOSITORY_INSTALL}" != *armbian-desktop* ]] && create_desktop_package
[[ -n "${RELEASE}" && "${DESKTOP_ENVIRONMENT}" && ! -f "${DEB_STORAGE}/${RELEASE}/${BSP_DESKTOP_PACKAGE_FULLNAME}.deb" && "${REPOSITORY_INSTALL}" != *armbian-bsp-desktop* ]] && create_bsp_desktop_package
# skip image creation if exists. useful for CI when making a lot of images
if [ "$IMAGE_PRESENT" == yes ] && ls "${FINALDEST}/${VENDOR}_${REVISION}_${BOARD^}_${RELEASE}_${BRANCH}_${VER/-$LINUXFAMILY/}${DESKTOP_ENVIRONMENT:+_$DESKTOP_ENVIRONMENT}"*.xz 1> /dev/null 2>&1; then
display_alert "Skipping image creation" "image already made - IMAGE_PRESENT is set" "wrn"
exit
fi
# build additional packages
[[ $EXTERNAL_NEW == compile ]] && chroot_build_packages