Skip to content
Snippets Groups Projects
Commit bf0d88ee authored by Lorenzo Pagliai's avatar Lorenzo Pagliai
Browse files

[CHECK] Insert script to check artifacts presence

* The script search for all type of artifacts (uboot, kernel, fs, image
files) and exit with an error in case something is missing
* This prevent to have build jobs that succed even though not all
artifacts were produced
parent 650b961d
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,8 @@ build-edgehog-a62:
DEFCONFIG_FILE: seco_sbc_a62_edgehog
RECIPE_NAME: seco-image-edgehog
IMAGE_NAME: edgehog-things-image
UBOOT_FILE: u-boot.imx
KERNEL_FILE: zImage
deploy-edgehog-a62:
extends: .deploy
......@@ -20,8 +22,6 @@ deploy-edgehog-a62:
artifacts: true
variables: &deploy-edgehog-a62
<<: *build-edgehog-a62
UBOOT_FILE: u-boot.imx
KERNEL_FILE: zImage
AZURE_PATH: imx6/a62
#############################
......
......@@ -12,6 +12,8 @@ build-edgehog-c12:
DEFCONFIG_FILE: seco_smarc_c12_edgehog
RECIPE_NAME: seco-image-edgehog
IMAGE_NAME: edgehog-things-image
UBOOT_FILE: imx-boot
KERNEL_FILE: Image
deploy-edgehog-c12:
extends: .deploy
......@@ -20,8 +22,6 @@ deploy-edgehog-c12:
artifacts: true
variables: &deploy-edgehog-c12
<<: *build-edgehog-c12
UBOOT_FILE: imx-boot
KERNEL_FILE: Image
AZURE_PATH: imx8/c12
#############################
......
......@@ -12,6 +12,8 @@ build-edgehog-c20:
DEFCONFIG_FILE: seco_sbc_c20_edgehog
RECIPE_NAME: seco-image-edgehog
IMAGE_NAME: edgehog-things-image
UBOOT_FILE: imx-boot
KERNEL_FILE: Image
deploy-edgehog-c20:
extends: .deploy
......@@ -20,8 +22,6 @@ deploy-edgehog-c20:
artifacts: true
variables: &deploy-edgehog-c20
<<: *build-edgehog-c20
UBOOT_FILE: imx-boot
KERNEL_FILE: Image
AZURE_PATH: imx8/c20
#############################
......
......@@ -12,6 +12,8 @@ build-edgehog-c26:
DEFCONFIG_FILE: seco_q7_c26_edgehog
RECIPE_NAME: seco-image-edgehog
IMAGE_NAME: edgehog-things-image
UBOOT_FILE: imx-boot
KERNEL_FILE: Image
deploy-edgehog-c26:
extends: .deploy
......@@ -20,8 +22,6 @@ deploy-edgehog-c26:
artifacts: true
variables: &deploy-edgehog-c26
<<: *build-edgehog-c26
UBOOT_FILE: imx-boot
KERNEL_FILE: Image
AZURE_PATH: imx8/c26
#############################
......
......@@ -13,6 +13,8 @@ build-edgehog-c31:
RECIPE_NAME: seco-image-edgehog
IMAGE_NAME: edgehog-things-image
KERNEL: 4-19-111
UBOOT_FILE: uboot.img trust.img idblock.img
KERNEL_FILE: Image
deploy-edgehog-c31:
extends: .deploy
......@@ -21,8 +23,6 @@ deploy-edgehog-c31:
artifacts: true
variables: &deploy-edgehog-c31
<<: *build-edgehog-c31
UBOOT_FILE: uboot.img trust.img idblock.img
KERNEL_FILE: Image
AZURE_PATH: rockchip/c31
#############################
......
......@@ -12,6 +12,8 @@ build-edgehog-c43:
DEFCONFIG_FILE: seco_sbc_c43_edgehog
RECIPE_NAME: seco-image-edgehog
IMAGE_NAME: edgehog-things-image
UBOOT_FILE: imx-boot
KERNEL_FILE: Image
deploy-edgehog-c43:
extends: .deploy
......@@ -20,8 +22,6 @@ deploy-edgehog-c43:
artifacts: true
variables: &deploy-edgehog-c43
<<: *build-edgehog-c43
UBOOT_FILE: imx-boot
KERNEL_FILE: Image
AZURE_PATH: imx8/c43
#############################
......
......@@ -12,6 +12,8 @@ build-edgehog-intel-apl:
DEFCONFIG_FILE: seco_intel_apl_edgehog
RECIPE_NAME: seco-image-edgehog
IMAGE_NAME: edgehog-things-image
UBOOT_FILE: none
KERNEL_FILE: none
deploy-edgehog-intel-apl:
extends: .deploy
......@@ -20,6 +22,4 @@ deploy-edgehog-intel-apl:
artifacts: true
variables: &deploy-edgehog-intel-apl
<<: *build-edgehog-intel-apl
UBOOT_FILE: none
KERNEL_FILE: none
AZURE_PATH: apollolake/Yocto
......@@ -12,6 +12,8 @@ build-edgehog-tanaro:
DEFCONFIG_FILE: seco_sbc_tanaro_edgehog
RECIPE_NAME: seco-image-edgehog
IMAGE_NAME: edgehog-things-image
UBOOT_FILE: imx-boot
KERNEL_FILE: Image
deploy-edgehog-tanaro:
extends: .deploy
......@@ -20,8 +22,6 @@ deploy-edgehog-tanaro:
artifacts: true
variables: &deploy-edgehog-tanaro
<<: *build-edgehog-tanaro
UBOOT_FILE: imx-boot
KERNEL_FILE: Image
AZURE_PATH: imx8/tanaro
#############################
......
......@@ -211,10 +211,11 @@ retrigger:
sh .gitlab-ci/scripts/build_setup.sh $GITBOT_TOKEN $CI_REPOSITORY_URL $BUILD_BRANCH $DEFCONFIG_FILE $RECIPE_NAME
. ./seco-setup.sh -d ${DEFCONFIG_FILE};
. ./seco-setup.sh -c;
sh ../.gitlab-ci/scripts/yocto_cache_setup.sh $PROCESSOR $CUSTOM
sh ../.gitlab-ci/scripts/yocto_cache_setup.sh $PROCESSOR $CUSTOM;
time bitbake ${RECIPE_NAME};
if [[ "$CI_JOB_NAME" != *"embedded"* ]]; then time bitbake seco-bundle-edgehog; fi;
"
- . ../.gitlab-ci/scripts/check_build_artifacts.sh
- echo "$BUILD_DIRECTORY/$IMAGES_PATH/$MACHINE" > $BASEDIR/pathname.txt
after_script:
......
#!/bin/bash
ARTIFACTS_DIR="$IMAGES_PATH/$MACHINE"
count_uboot_files=0
count_image=`ls -1 $ARTIFACTS_DIR/$KERNEL_FILE 2>/dev/null | wc -l`
count_dtb=`ls -1 $ARTIFACTS_DIR/*.dtb 2>/dev/null | wc -l`
count_dtbo=`ls -1 $ARTIFACTS_DIR/*.dtbo 2>/dev/null | wc -l`
count_fs=`ls -1 $ARTIFACTS_DIR/*.$FS_EXTENSION 2>/dev/null | wc -l`
count_wic=`ls -1 $ARTIFACTS_DIR/*.$IMAGE_EXTENSION 2>/dev/null | wc -l`
count_bundle=`ls -1 $ARTIFACTS_DIR/*.raucb 2>/dev/null | wc -l`
if [[ $UBOOT_FILE != *"none"* ]]; then
count_el=0
for i in $UBOOT_FILE; do
count_tmp=0
count_tmp=`ls -1 $ARTIFACTS_DIR/$i 2>/dev/null | wc -l`
count_uboot_files=$(($count_uboot_files+$count_tmp))
count_el=$((count_el+1))
done
if [ $count_uboot_files -eq 0 ]; then
echo "No uboot artifacts were compiled, exiting with error 1 .."
exit 1
elif [ $count_uboot_files -gt 0 ] && [ $count_uboot_files -lt "$count_el" ]; then
echo "uboot artifacts lower than expected found, warning!"
else
echo "All uboot artifacts were found!"
fi
fi
if [[ $KERNEL_FILE != *"none"* ]]; then
if [ $count_image -eq 0 ]; then
echo "No kernel image artifacts were compiled, exiting with error 1 .."
exit 1
else
echo "Kernel image artifacts were found!"
fi
if [ $count_dtb -eq 0 ]; then
echo "No dtb artifacts were compiled, exiting with error 1 .."
exit 1
else
echo "dtb artifacts were found!"
fi
if [ $count_dtbo -eq 0 ]; then
echo "No dtb artifacts were compiled, exiting with error 1 .."
exit 1
else
echo "dtb artifacts were found!"
fi
fi
if [ $count_fs -eq 0 ]; then
echo "No filesystem artifacts were compiled, exiting with error 1 .."
exit 1
else
echo "Filesystem artifacts were found!"
fi
if [ $count_wic -eq 0 ]; then
echo "No image artifacts were compiled, exiting with error 1 .."
exit 1
else
echo "Image artifacts were found!"
fi
if [[ "$CI_JOB_NAME" != *"embedded"* ]]; then
if [ $count_bundle -eq 0 ]; then
echo "No bundle artifacts were compiled, exiting with error 1 .."
exit 1
else
echo "Bundle artifacts were found!"
fi
fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment