Files
debian-base/.gitea/workflows/file.txt
fithwum ea288cd6eb
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
test
2025-12-20 16:07:08 -08:00

194 lines
6.9 KiB
Plaintext

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
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