1
0
mirror of https://github.com/lineageos4microg/docker-lineage-cicd synced 2024-11-09 10:09:56 +01:00

Zip up the .img files

This commit is contained in:
Pete 2023-12-05 12:31:07 +00:00 committed by Pete Fotheringham
parent 0ab43084fb
commit 23d31d6688

@ -423,8 +423,29 @@ for branch in ${BRANCH_NAME//,/ }; do
mv "$build" "$ZIP_DIR/$zipsubdir/" &>> "$DEBUG_LOG"
files_to_hash+=( "$build" )
done
cd "$source_dir/out/target/product/$codename/obj/PACKAGING/target_files_intermediates/lineage_$codename-target_files-eng.root/IMAGES/"
if [ "$ZIP_UP_IMAGES" = true ]; then
# zipping the .img files
echo ">> [$(date)] Zipping the .img files" | tee -a "$DEBUG_LOG"
files_to_zip=()
images_zip_file="lineage-$los_ver-$builddate-$RELEASE_TYPE-$codename-images.zip"
cd "$source_dir/out/target/product/$codename/obj/PACKAGING/target_files_intermediates/lineage_$codename-target_files-eng.root/IMAGES/"
for image in recovery boot vendor_boot dtbo super_empty vbmeta vendor_kernel_boot; do
if [ -f "$image.img" ]; then
echo ">> [$(date)] Adding $image.img" to "$images_zip_file" | tee -a "$DEBUG_LOG"
files_to_zip+=( "$image.img" )
fi
done
zip "$images_zip_file" "${files_to_zip[@]}"
mv "$images_zip_file" "$ZIP_DIR/$zipsubdir/"
files_to_hash+=( "$images_zip_file" )
else
# just copy the mages to the zips directory
echo ">> [$(date)] Zipping the '-img' files disabled"
for image in recovery boot vendor_boot dtbo super_empty vbmeta vendor_kernel_boot; do
if [ -f "$image.img" ]; then
recovery_name="lineage-$los_ver-$builddate-$RELEASE_TYPE-$codename-$image.img"
@ -433,6 +454,8 @@ for branch in ${BRANCH_NAME//,/ }; do
files_to_hash+=( "$recovery_name" )
fi
done
fi
cd "$ZIP_DIR/$zipsubdir"
for f in "${files_to_hash[@]}"; do
sha256sum "$f" > "$ZIP_DIR/$zipsubdir/$f.sha256sum"
@ -445,6 +468,7 @@ for branch in ${BRANCH_NAME//,/ }; do
else
echo ">> [$(date)] Calling mka for $codename, $branch branch disabled"
fi
fi
# Remove old zips and logs
if [ "$DELETE_OLD_ZIPS" -gt "0" ]; then
@ -463,7 +487,7 @@ for branch in ${BRANCH_NAME//,/ }; do
fi
if [ -f /root/userscripts/post-build.sh ]; then
echo ">> [$(date)] Running post-build.sh for $codename" >> "$DEBUG_LOG"
/root/userscripts/post-build.sh "$codename" $build_successful "$branch" &>> "$DEBUG_LOG" || echo ">> [$(date)] Warning: post-build.sh failed!"
/root/userscripts/post-build.sh "$codename" "$build_successful" "$branch" &>> "$DEBUG_LOG" || echo ">> [$(date)] Warning: post-build.sh failed!"
fi
echo ">> [$(date)] Finishing build for $codename" | tee -a "$DEBUG_LOG"
@ -492,8 +516,6 @@ for branch in ${BRANCH_NAME//,/ }; do
(set +eu ; mka "${jobs_arg[@]}" clean) &>> "$DEBUG_LOG"
fi
fi
fi
done
fi
done