overlay/rebuild-manifest.sh
Jared Allard c0d6f5971d
feat: automatic updates and elint (#1)
Adds an automatic updater to handle updating ebuilds in this repository
based on the latest version available on the remote.

Also puts `elint` in this repo since I've been working on this one more
than the former.
2024-02-18 17:52:09 -08:00

23 lines
649 B
Bash
Executable file

#!/usr/bin/env bash
# Rebuilds a Manifest file for the provided ebuild.
ebuild_path="$1"
if [[ -z "$ebuild_path" ]]; then
echo "Error: Missing ebuild path" >&1
exit 1
fi
if [[ ! -d "$ebuild_path" ]]; then
echo "Error: Invalid ebuild path (must be directory)" >&1
exit 1
fi
imageName="ghcr.io/jaredallard/overlay:updater"
# Build the image if it doesn't already exist in the cache.
if ! docker image inspect "$imageName" >/dev/null; then
docker buildx build --load -t "$imageName" .
fi
exec docker run --rm -it -v "$(pwd):/host_mnt" --entrypoint bash "$imageName" -ce 'cd "/host_mnt/$1" && ebuild *.ebuild manifest' -- "$ebuild_path"