retry build stages if failed

This commit is contained in:
ading2210 2024-01-30 22:25:45 +00:00
parent ad4f759fab
commit ef6b605961
3 changed files with 11 additions and 4 deletions

View File

@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: run build - name: run build
run: sudo DEBUG=1 ./build_complete.sh ${{ matrix.board }} compress_img=1 quiet_download=1 run: sudo DEBUG=1 ./build_complete.sh ${{ matrix.board }} compress_img=1 quiet=1
- name: upload img - name: upload img
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View File

@ -93,6 +93,13 @@ download_and_unzip() {
fi fi
} }
retry_cmd() {
local cmd="$@"
for i in 1 2 3 4 5; do
$cmd && break
done
}
echo "downloading recovery image" echo "downloading recovery image"
download_and_unzip $reco_url $reco_zip $reco_bin download_and_unzip $reco_url $reco_zip $reco_bin
@ -115,12 +122,12 @@ else
fi fi
echo "patching debian rootfs" echo "patching debian rootfs"
./patch_rootfs.sh $shim_bin $reco_bin $rootfs_dir "quiet=${args['quiet']}" retry_cmd ./patch_rootfs.sh $shim_bin $reco_bin $rootfs_dir "quiet=${args['quiet']}"
echo "building final disk image" echo "building final disk image"
final_image="$base_dir/data/shimboot_$board.bin" final_image="$base_dir/data/shimboot_$board.bin"
rm -rf $final_image rm -rf $final_image
./build.sh $final_image $shim_bin $rootfs_dir retry_cmd ./build.sh $final_image $shim_bin $rootfs_dir "quiet=${args['quiet']}"
echo "build complete! the final disk image is located at $final_image" echo "build complete! the final disk image is located at $final_image"
if [ "${args['compress_img']}" ]; then if [ "${args['compress_img']}" ]; then

View File

@ -69,7 +69,7 @@ safe_mount() {
rm -rf $2 rm -rf $2
mkdir -p $2 mkdir -p $2
#try to mount multiple times #try to mount multiple times
mount $1 $2 || mount $1 $2 || mount $1 $2 || mount $1 $2 mount $1 $2
} }
create_partitions() { create_partitions() {