PepMiniiso/PepDeb32/BldHelper-release.sh

50 lines
1.6 KiB
Bash
Raw Normal View History

2023-03-28 12:48:46 +00:00
#!/bin/bash
2023-05-12 11:17:22 +00:00
################################################################################
# Title: Bldhelper.sh
2023-05-23 09:35:48 +00:00
# Description: Script to build PeppermintOS ISO image
2023-05-12 11:17:22 +00:00
# Author: PeppermintOS Team <peppermintosteam@proton.me>
# Date: May 10, 2023
# License: GPL-3.0-or-later
################################################################################
2023-03-28 12:48:46 +00:00
2023-05-23 10:45:50 +00:00
# Set environment variables
PREFIX=PepMini
SUFFIX=dev-i386
BUILD=PepDev32
TODAY=$(date -u +"%Y-%m-%d")
FileName="${PREFIX}-${SUFFIX}"
LOCATION=/var/www/html/nightly/PepMini/${BUILD}
LogDir=/var/log/Live-Build
WorkingDir=/home/pepadmin/PepMini/PepDev32
# Execute the ISO building script
2023-03-28 13:28:50 +00:00
cd ${WorkingDir}
2023-05-23 10:45:50 +00:00
./pepbld.sh
2023-03-28 13:28:50 +00:00
2023-05-23 10:45:50 +00:00
# Move and rename the ISO file
cd fusato
mv *.iso ${FileName}-${TODAY}.iso
2023-03-28 12:48:46 +00:00
2023-05-23 10:45:50 +00:00
# Create the checksum file for the ISO
sha512sum ${FileName}-${TODAY}.iso > ${FileName}-${TODAY}-sha512.checksum
2023-03-28 12:48:46 +00:00
2023-05-23 10:45:50 +00:00
# Move the ISO and checksum files to the desired location
mkdir -p ${LOCATION}
mv ${FileName}-${TODAY}.iso ${LOCATION}
mv ${FileName}-${TODAY}-sha512.checksum ${LOCATION}
2023-03-28 12:48:46 +00:00
2023-05-23 10:45:50 +00:00
# Remove old ISO and checksum files from the desired location
2023-05-15 11:21:09 +00:00
rm -f ${LOCATION}/${FileName}*.iso
rm -f ${LOCATION}/${FileName}*-sha512.checksum
2023-03-28 12:48:46 +00:00
2023-05-23 10:45:50 +00:00
# Move the log file to the log directory
2023-03-28 12:48:46 +00:00
[ ! -e ${LogDir} ] && mkdir -p ${LogDir}
2023-05-23 10:45:50 +00:00
mv /tmp/${PREFIX}${SUFFIX}.out ${LogDir}/${PREFIX}-${SUFFIX}-${BUILD}.log
2023-05-23 09:08:34 +00:00
2023-05-23 10:45:50 +00:00
# Remove old files from the cache
grep "Del " ${LogDir}/${PREFIX}-${SUFFIX}-${BUILD}.log | sort -u | cut -f2,3 -d" " | tr " " "_" | tr ":" "*" | tr "+" "*" | xargs -I {} find ./cache/packages.* -name "{}*.deb" -delete
2023-05-23 09:08:34 +00:00
2023-05-23 10:45:50 +00:00
# Remove the "fusato" directory and its contents
rm -rf fusato