diff --git a/.gitea/workflows/base-build.yml b/.gitea/workflows/base-build.yml index 864407d..ee0c226 100644 --- a/.gitea/workflows/base-build.yml +++ b/.gitea/workflows/base-build.yml @@ -17,6 +17,7 @@ env: GIT_EMAIL: ${{ secrets.GIT_EMAIL }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + VERSIONS: "buster bullseye bookworm docker-build" jobs: build-rootfs-archives: @@ -27,30 +28,7 @@ jobs: - name: Build all Debian rootfs versions sequentially run: | - versions=(buster bullseye bookworm trixie docker-build) - - for version in "${versions[@]}"; do - echo "[INFO] Building Debian $version rootfs..." - docker build --build-arg VERSION=$version -t fithwum/debian-$version-base . - - docker run --rm --privileged \ - -v "$(pwd)":/output \ - fithwum/debian-$version-base \ - bash base-image-script/debian-${version}_pt1.sh - - echo "[DEBUG] Host contents after docker run for $version:" && \ - find . -maxdepth 2 -type f -name "*.tar.bz2" -print - - # Auto-detect output tarball and move it if needed - expected_path="./$version/debian-$version.tar.bz2" - fallback_path="./debian-$version.tar.bz2" - - if [ -f "$fallback_path" ] && [ ! -f "$expected_path" ]; then - mkdir -p "./$version" - mv "$fallback_path" "$expected_path" - echo "[INFO] Moved fallback tarball to expected path: $expected_path" - fi - done + versions=($VERSIONS) # for version in "${versions[@]}"; do # echo "[INFO] Building Debian $version rootfs..." @@ -60,8 +38,31 @@ jobs: # -v "$(pwd)":/output \ # fithwum/debian-$version-base \ # bash base-image-script/debian-${version}_pt1.sh + + # echo "[DEBUG] Host contents after docker run for $version:" && \ + # find . -maxdepth 2 -type f -name "*.tar.bz2" -print + + # # Auto-detect output tarball and move it if needed + # expected_path="./$version/debian-$version.tar.bz2" + # fallback_path="./debian-$version.tar.bz2" + + # if [ -f "$fallback_path" ] && [ ! -f "$expected_path" ]; then + # mkdir -p "./$version" + # mv "$fallback_path" "$expected_path" + # echo "[INFO] Moved fallback tarball to expected path: $expected_path" + # fi # done + for version in "${versions[@]}"; do + echo "[INFO] Building Debian $version rootfs..." + docker build --build-arg VERSION=$version -t fithwum/debian-$version-base . + + docker run --rm --privileged \ + -v "$(pwd)":/output \ + fithwum/debian-$version-base \ + bash base-image-script/debian-${version}_pt1.sh + done + - name: List output archives run: | echo "[INFO] Looking for tarballs in workspace..." @@ -155,7 +156,7 @@ jobs: IMAGE_ORG=fithwum IMAGE_REPO=debian-base - for TAG in buster bullseye bookworm docker-build; do + for TAG in $VERSIONS; do FULL_IMAGE="${IMAGE_REGISTRY}/${IMAGE_ORG}/${IMAGE_REPO}:${TAG}" echo "[INFO] Building and pushing $FULL_IMAGE" docker buildx build --platform linux/amd64 --push -t "$FULL_IMAGE" "./$TAG" @@ -174,7 +175,7 @@ jobs: - name: Generate per-version changelogs run: | cd upload-repo - for version in buster bullseye bookworm trixie docker-build; do + for version in $VERSIONS; do echo "[INFO] Updating changelog for $version" changelog="$version/CHANGES.md" @@ -239,7 +240,7 @@ jobs: } cd upload-repo - for version in buster bullseye bookworm trixie docker-build; do + for version in $VERSIONS; do echo "[INFO] Generating build-info.json for $version" mkdir -p "$version" infofile="$version/build-info.json" @@ -293,7 +294,7 @@ jobs: git push # Tag the commit for each version - for version in buster bullseye bookworm trixie docker-build; do + for version in $VERSIONS; do TAG="build-$version" # Delete local tag if exists git tag -d "$TAG" 2>/dev/null || true