This commit is contained in:
2025-12-07 17:11:07 +06:00
parent b46968519e
commit fd9a69c679
2 changed files with 22 additions and 8 deletions

View File

@@ -9,6 +9,7 @@ CTX="${WORK_DIR}/ctx"
IMAGE="docker.io/gentoo/stage3:amd64-desktop-openrc"
CONTAINER_NAME="gentoo_builder"
PROFILE="default/linux/amd64/23.0/desktop"
LOG_FILE="/var/log/gentoo_build.log" # inside container
if [[ ! -d "$REPO/.git" ]]; then
git clone "$REPO_URL" "$REPO"
@@ -92,7 +93,8 @@ podman cp "$CTX/var/lib/portage/world" "$CONTAINER_NAME":/var/lib/portage/world
echo "Starting Builder..."
podman exec -i "$CONTAINER_NAME" /bin/bash <<EOF
cat <<EOF | podman exec -i "$CONTAINER_NAME" sh -c "cat > /usr/local/bin/run_job.sh"
#!/bin/bash
set -e
source /etc/profile
@@ -115,7 +117,14 @@ emerge --verbose --usepkg --buildpkg \
echo "Cleaning up.."
emerge --depclean
emaint binhost --fix
echo "[$(date)] Build Finished successfully."
EOF
echo "Build complete."
echo "Triggering build in background..."
podman exec -d "$CONTAINER_NAME" bash -c "chmod +x /usr/local/bin/run_job.sh && /usr/local/bin/run_job.sh > $LOG_FILE 2>&1"
echo "Build is running in the background."
echo "To view progress, run:"
echo " podman exec -it $CONTAINER_NAME tail -f $LOG_FILE"