Merge pull request #7 from peachcloud/img_compression

Add compression for build release
This commit is contained in:
Max Fowler 2021-03-16 09:01:52 +01:00 committed by GitHub
commit 8774644443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -6,7 +6,15 @@ make raspi_3.img
# copy to releases
TODAY=$(date +"%Y%m%d")
RELEASE_DIR=/var/www/releases.peachcloud.org/html/peach-imgs/$TODAY
echo "++ successful image build, copying output to ${RELEASE_DIR}"
mkdir -p $RELEASE_DIR
cp raspi_3.img $RELEASE_DIR/${TODAY}_peach_raspi3.img
cp raspi_3.log $RELEASE_DIR/${TODAY}_peach_raspi3.log
echo "++ successful image build, performing compression"
xz -k raspi.img
status=$?
if [ $status -eq 0 ]; then
echo "++ compression successful, copying compressed img to ${RELEASE_DIR}"
cp raspi_3.img.xz $RELEASE_DIR/${TODAY}_peach_raspi3.img.xz
else
echo "++ compression failed, copying uncompressed img to ${RELEASE_DIR}"
cp raspi_3.img $RELEASE_DIR/${TODAY}_peach_raspi3.img
fi
cp raspi_3.log $RELEASE_DIR/${TODAY}_peach_raspi3.log