test
Some checks failed
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Docker prune (vm-docker-build2) (push) Successful in 3s
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build RootFS Archives (bookworm) (push) Has been cancelled
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build RootFS Archives (bullseye) (push) Has been cancelled
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build RootFS Archives (trixie) (push) Has been cancelled
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build & Push Docker Images (bookworm) (push) Has been cancelled
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build & Push Docker Images (bullseye) (push) Has been cancelled
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build & Push Docker Images (trixie) (push) Has been cancelled
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / generate-changelogs (push) Has been cancelled
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / generate-build-info (push) Has been cancelled

This commit is contained in:
2025-12-20 16:07:08 -08:00
parent c779056609
commit ea288cd6eb
2 changed files with 110 additions and 105 deletions

View File

@@ -41,98 +41,6 @@ jobs:
echo "[INFO] Pruning Docker images on ${{ matrix.runner }}..."
docker image prune -a -f || true
# build-and-push-rootfs-archives:
# runs-on: vm-docker-build2
# outputs:
# archives_changed: ${{ steps.commit_archives.outputs.archives_changed }}
# steps:
# - name: Checkout source
# uses: actions/checkout@v3
# - name: Create output directory
# run: mkdir -p ./output
# - name: Build all Debian rootfs versions into volumes and extract
# run: |
# versions=($VERSIONS)
# for version in "${versions[@]}"; do
# echo "[INFO] Building $version..."
# volume_name="build_output_$version"
# docker volume create "$volume_name"
# docker build --build-arg VERSION=$version -t fithwum/debian-$version-base .
# docker run --rm --privileged \
# -v "$volume_name:/output" \
# -e VERSION="$version" \
# fithwum/debian-$version-base \
# bash -c "/scripts/bootstrap-rootfs.sh \"$version\""
# # Extract the output file from the volume
# container_id=$(docker create -v "$volume_name:/output" debian)
# mkdir -p ./output/$version
# docker cp "$container_id:/output/$version/debian-$version.tar.bz2" ./output/$version/
# docker rm "$container_id"
# done
# - name: Validate that archives exist for each version
# run: |
# IFS=' ' read -r -a versions <<< "$VERSIONS"
# for version in "${versions[@]}"; do
# path="./output/$version/debian-$version.tar.bz2"
# if [[ ! -f "$path" ]]; then
# echo "[ERROR] Missing archive: $path"
# exit 1
# else
# echo "[OK] Found: $path"
# fi
# done
# - name: Clone upload repo
# run: |
# GIT_CREDENTIAL="${{ secrets.GIT_TOKEN || secrets.GIT_PASSWORD }}"
# git clone --depth=1 "https://${{ env.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo
# - name: Clean old archives in upload-repo
# run: rm -rfv upload-repo/*/*.tar.bz2
# - name: Copy new archives to upload-repo
# run: |
# for filepath in ./output/*/debian-*.tar.bz2; do
# version_dir=$(basename "$(dirname "$filepath")")
# mkdir -p "upload-repo/$version_dir"
# cp "$filepath" "upload-repo/$version_dir/"
# done
# - name: Calculate and store sha256sums in upload-repo
# run: |
# cd upload-repo
# rm -f sha256sums.txt
# for tarball in */debian-*.tar.bz2; do
# echo "[INFO] Processing: $tarball"
# checksum=$(sha256sum "$tarball" | awk '{print $1}')
# echo "$checksum $tarball" >> sha256sums.txt
# done
# echo "[INFO] SHA256 contents:"
# cat sha256sums.txt
# - name: Commit and push files if changed
# id: commit_archives
# run: |
# cd upload-repo
# git config --global user.name "${{ env.GIT_USERNAME }}"
# git config --global user.email "${{ env.GIT_EMAIL }}"
# if git status --porcelain | grep .; then
# git add **/*.tar.bz2 sha256sums.txt || true
# git commit -m "Update base images and checksum on $(date -u +'%Y-%m-%dT%H:%M:%SZ') [skip ci]"
# git push
# echo "archives_changed=true" >> $GITHUB_OUTPUT
# else
# echo "[INFO] No changes to commit."
# echo "archives_changed=false" >> $GITHUB_OUTPUT
# fi
build-and-push-rootfs-archives:
name: Build RootFS Archives (${{ matrix.version }})
runs-on: vm-docker-build2
@@ -364,12 +272,22 @@ jobs:
- name: Checkout source
uses: actions/checkout@v3
- name: Fetch rootfs tarball from upload repo
run: |
VERSION=${{ matrix.version }}
git clone --depth=1 "https://${{ env.GIT_USERNAME }}:${{ secrets.GIT_TOKEN }}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo
mkdir -p "./output/$VERSION"
if [[ ! -f "upload-repo/$VERSION/debian-$VERSION.tar.bz2" ]]; then
echo "[ERROR] Rootfs tarball not found in upload-repo for $VERSION"
exit 1
fi
cp "upload-repo/$VERSION/debian-$VERSION.tar.bz2" "./output/$VERSION/"
- name: Prepare Docker context
run: |
VERSION=${{ matrix.version }}
CONTEXT_DIR="$VERSION"
mkdir -p "$CONTEXT_DIR"
echo "[INFO] Copying rootfs tarball into Docker context..."
cp "./output/$VERSION/debian-$VERSION.tar.bz2" "$CONTEXT_DIR/"
- name: Generate Dockerfile
@@ -403,25 +321,15 @@ jobs:
TAR="./output/$VERSION/debian-$VERSION.tar.bz2"
if [[ ! -f "$TAR" ]]; then
echo "[ERROR] Rootfs tarball not found: $TAR"
echo "[ERROR] Rootfs tarball missing: $TAR"
exit 1
fi
# Skip build if image already exists with same digest
if docker pull "$FULL_IMAGE" >/dev/null 2>&1; then
EXISTING_DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' "$FULL_IMAGE")
NEW_DIGEST=$(sha256sum "$TAR" | awk '{print $1}')
if [[ "$EXISTING_DIGEST" == *"$NEW_DIGEST"* ]]; then
echo "[INFO] Docker image for $VERSION is up-to-date, skipping build."
exit 0
fi
fi
echo "[INFO] Building and pushing Docker image: $FULL_IMAGE"
docker buildx build --platform linux/amd64 --push -t "$FULL_IMAGE" "./$VERSION"
generate-changelogs:
needs: build-and-push-rootfs-archives
needs: build-and-push-docker-images
runs-on: vm-docker-build2
steps:
- name: Checkout source

View File

@@ -3,6 +3,103 @@ VERSIONS: "buster bullseye bookworm"
# build-and-push-rootfs-archives:
# runs-on: vm-docker-build2
# outputs:
# archives_changed: ${{ steps.commit_archives.outputs.archives_changed }}
# steps:
# - name: Checkout source
# uses: actions/checkout@v3
# - name: Create output directory
# run: mkdir -p ./output
# - name: Build all Debian rootfs versions into volumes and extract
# run: |
# versions=($VERSIONS)
# for version in "${versions[@]}"; do
# echo "[INFO] Building $version..."
# volume_name="build_output_$version"
# docker volume create "$volume_name"
# docker build --build-arg VERSION=$version -t fithwum/debian-$version-base .
# docker run --rm --privileged \
# -v "$volume_name:/output" \
# -e VERSION="$version" \
# fithwum/debian-$version-base \
# bash -c "/scripts/bootstrap-rootfs.sh \"$version\""
# # Extract the output file from the volume
# container_id=$(docker create -v "$volume_name:/output" debian)
# mkdir -p ./output/$version
# docker cp "$container_id:/output/$version/debian-$version.tar.bz2" ./output/$version/
# docker rm "$container_id"
# done
# - name: Validate that archives exist for each version
# run: |
# IFS=' ' read -r -a versions <<< "$VERSIONS"
# for version in "${versions[@]}"; do
# path="./output/$version/debian-$version.tar.bz2"
# if [[ ! -f "$path" ]]; then
# echo "[ERROR] Missing archive: $path"
# exit 1
# else
# echo "[OK] Found: $path"
# fi
# done
# - name: Clone upload repo
# run: |
# GIT_CREDENTIAL="${{ secrets.GIT_TOKEN || secrets.GIT_PASSWORD }}"
# git clone --depth=1 "https://${{ env.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo
# - name: Clean old archives in upload-repo
# run: rm -rfv upload-repo/*/*.tar.bz2
# - name: Copy new archives to upload-repo
# run: |
# for filepath in ./output/*/debian-*.tar.bz2; do
# version_dir=$(basename "$(dirname "$filepath")")
# mkdir -p "upload-repo/$version_dir"
# cp "$filepath" "upload-repo/$version_dir/"
# done
# - name: Calculate and store sha256sums in upload-repo
# run: |
# cd upload-repo
# rm -f sha256sums.txt
# for tarball in */debian-*.tar.bz2; do
# echo "[INFO] Processing: $tarball"
# checksum=$(sha256sum "$tarball" | awk '{print $1}')
# echo "$checksum $tarball" >> sha256sums.txt
# done
# echo "[INFO] SHA256 contents:"
# cat sha256sums.txt
# - name: Commit and push files if changed
# id: commit_archives
# run: |
# cd upload-repo
# git config --global user.name "${{ env.GIT_USERNAME }}"
# git config --global user.email "${{ env.GIT_EMAIL }}"
# if git status --porcelain | grep .; then
# git add **/*.tar.bz2 sha256sums.txt || true
# git commit -m "Update base images and checksum on $(date -u +'%Y-%m-%dT%H:%M:%SZ') [skip ci]"
# git push
# echo "archives_changed=true" >> $GITHUB_OUTPUT
# else
# echo "[INFO] No changes to commit."
# echo "archives_changed=false" >> $GITHUB_OUTPUT
# fi
build-and-push-rootfs-archives:
runs-on: vm-docker-build2