piston/repo/entrypoint.sh

38 lines
785 B
Bash
Raw Normal View History

cd /piston/packages
2021-03-14 00:33:15 +01:00
SERVER=1
2021-03-14 01:21:06 +01:00
BUILD=1
echo "Running through arguments.."
2021-03-14 00:33:15 +01:00
for pkg in "$@"
do
2021-03-14 01:21:06 +01:00
if [[ "$pkg" = "--no-server" ]]; then
echo "Not starting index server after builds"
SERVER=0
elif [[ "$pkg" = "--no-build" ]]; then
echo "Building no more package"
BUILD=0
else
if [[ $BUILD -eq 1 ]]; then
echo "Building package $pkg"
make -j16 $pkg.pkg.tar.gz
echo "Done with package $pkg"
else
echo "Building was disabled, skipping $pkg"
fi
fi
done
cd /piston/repo
2021-03-14 01:21:06 +01:00
echo "Creating index"
./mkindex.sh
2021-03-14 01:21:06 +01:00
echo "Index created"
2021-03-14 01:21:06 +01:00
if [[ $SERVER -eq 1 ]]; then
echo "Starting index server.."
python3 -m http.server
else
echo "Skipping starting index server"
fi
2021-03-14 01:06:04 +01:00
exit 0