Update .gitea/workflows/base-build.yml
Some checks failed
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build rootfs (trixie) (push) Failing after 2m30s
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build rootfs (bookworm) (push) Has started running
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build rootfs (bullseye) (push) Has started running
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 started running
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / generate-build-info (push) Has been cancelled
Some checks failed
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build rootfs (trixie) (push) Failing after 2m30s
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build rootfs (bookworm) (push) Has started running
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / Build rootfs (bullseye) (push) Has started running
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 started running
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / generate-build-info (push) Has been cancelled
This commit is contained in:
@@ -26,168 +26,173 @@ env:
|
|||||||
OUTPUT_DIR: ./output
|
OUTPUT_DIR: ./output
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-rootfs-archives:
|
# 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-rootfs:
|
|
||||||
# name: Build rootfs (${{ matrix.version }})
|
|
||||||
# runs-on: vm-docker-build2
|
# runs-on: vm-docker-build2
|
||||||
|
# outputs:
|
||||||
# strategy:
|
# archives_changed: ${{ steps.commit_archives.outputs.archives_changed }}
|
||||||
# fail-fast: false
|
|
||||||
# matrix:
|
|
||||||
# version: [bullseye, bookworm, trixie]
|
|
||||||
|
|
||||||
# steps:
|
# steps:
|
||||||
# - uses: actions/checkout@v3
|
# - name: Checkout source
|
||||||
|
# uses: actions/checkout@v3
|
||||||
|
|
||||||
# - name: Ensure output directory exists
|
# - name: Create output directory
|
||||||
# run: mkdir -p ${{ env.OUTPUT_DIR }}/${{ matrix.version }}
|
# run: mkdir -p ./output
|
||||||
|
|
||||||
# - name: Build rootfs tarball
|
# - name: Build all Debian rootfs versions into volumes and extract
|
||||||
# run: |
|
# run: |
|
||||||
# VERSION=${{ matrix.version }}
|
# versions=($VERSIONS)
|
||||||
# OUT_DIR=${{ env.OUTPUT_DIR }}/$VERSION
|
# for version in "${versions[@]}"; do
|
||||||
|
# echo "[INFO] Building $version..."
|
||||||
|
# volume_name="build_output_$version"
|
||||||
|
# docker volume create "$volume_name"
|
||||||
|
|
||||||
# docker build \
|
# docker build --build-arg VERSION=$version -t fithwum/debian-$version-base .
|
||||||
# --build-arg VERSION="$VERSION" \
|
|
||||||
# -t rootfs-$VERSION .
|
|
||||||
|
|
||||||
# docker run --rm \
|
# docker run --rm --privileged \
|
||||||
# -v "$(pwd)/$OUT_DIR:/output" \
|
# -v "$volume_name:/output" \
|
||||||
# rootfs-$VERSION \
|
# -e VERSION="$version" \
|
||||||
# bash -c "/scripts/bootstrap-rootfs.sh $VERSION /output"
|
# fithwum/debian-$version-base \
|
||||||
|
# bash -c "/scripts/bootstrap-rootfs.sh \"$version\""
|
||||||
|
|
||||||
# if [[ ! -f "$OUT_DIR/debian-$VERSION.tar.bz2" ]]; then
|
# # Extract the output file from the volume
|
||||||
# echo "[ERROR] Rootfs tarball not found at $OUT_DIR/debian-$VERSION.tar.bz2"
|
# 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
|
# exit 1
|
||||||
# else
|
# else
|
||||||
# echo "[OK] Rootfs tarball created at $OUT_DIR/debian-$VERSION.tar.bz2"
|
# echo "[OK] Found: $path"
|
||||||
# fi
|
# fi
|
||||||
|
# done
|
||||||
|
|
||||||
# - name: Clone upload repo
|
# - name: Clone upload repo
|
||||||
# run: |
|
# run: |
|
||||||
# git clone --depth=1 \
|
# GIT_CREDENTIAL="${{ secrets.GIT_TOKEN || secrets.GIT_PASSWORD }}"
|
||||||
# https://${GIT_USERNAME}:${GIT_TOKEN}@gitea.fithwum.tech/fithwum/debian-base.git upload
|
# git clone --depth=1 "https://${{ env.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo
|
||||||
|
|
||||||
# - name: Update archive + sha256
|
# - name: Clean old archives in upload-repo
|
||||||
|
# run: rm -rfv upload-repo/*/*.tar.bz2
|
||||||
|
|
||||||
|
# - name: Copy new archives to upload-repo
|
||||||
# run: |
|
# run: |
|
||||||
# VERSION=${{ matrix.version }}
|
# for filepath in ./output/*/debian-*.tar.bz2; do
|
||||||
# OUT_DIR=${{ env.OUTPUT_DIR }}/$VERSION
|
# version_dir=$(basename "$(dirname "$filepath")")
|
||||||
|
# mkdir -p "upload-repo/$version_dir"
|
||||||
|
# cp "$filepath" "upload-repo/$version_dir/"
|
||||||
|
# done
|
||||||
|
|
||||||
# mkdir -p upload/$VERSION
|
# - name: Calculate and store sha256sums in upload-repo
|
||||||
# cp "$OUT_DIR/debian-$VERSION.tar.bz2" "upload/$VERSION/"
|
|
||||||
|
|
||||||
# cd upload
|
|
||||||
# # Remove previous sha256 entry for this version
|
|
||||||
# sed -i "/debian-$VERSION.tar.bz2/d" sha256sums.txt 2>/dev/null || true
|
|
||||||
# sha256sum "$VERSION/debian-$VERSION.tar.bz2" >> sha256sums.txt
|
|
||||||
|
|
||||||
# - name: Commit if changed
|
|
||||||
# run: |
|
# run: |
|
||||||
# VERSION=${{ matrix.version }}
|
# 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
|
||||||
|
|
||||||
# cd upload
|
# - name: Commit and push files if changed
|
||||||
# git config user.name "$GIT_USERNAME"
|
# id: commit_archives
|
||||||
# git config user.email "$GIT_EMAIL"
|
# 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
|
# if git status --porcelain | grep .; then
|
||||||
# git add "$VERSION/debian-$VERSION.tar.bz2" sha256sums.txt
|
# git add **/*.tar.bz2 sha256sums.txt || true
|
||||||
# git commit -m "Update rootfs for $VERSION [skip ci]"
|
# git commit -m "Update base images and checksum on $(date -u +'%Y-%m-%dT%H:%M:%SZ') [skip ci]"
|
||||||
# git push
|
# git push
|
||||||
|
# echo "archives_changed=true" >> $GITHUB_OUTPUT
|
||||||
# else
|
# else
|
||||||
# echo "[INFO] No changes for $VERSION"
|
# echo "[INFO] No changes to commit."
|
||||||
|
# echo "archives_changed=false" >> $GITHUB_OUTPUT
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
|
build-rootfs:
|
||||||
|
name: Build rootfs (${{ matrix.version }})
|
||||||
|
runs-on: vm-docker-build2
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
version: [bullseye, bookworm, trixie]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Create output directory
|
||||||
|
run: mkdir -p ${{ env.OUTPUT_DIR }}/${{ matrix.version }}
|
||||||
|
|
||||||
|
- name: Build rootfs Docker image
|
||||||
|
run: |
|
||||||
|
VERSION=${{ matrix.version }}
|
||||||
|
docker build \
|
||||||
|
--build-arg VERSION="$VERSION" \
|
||||||
|
-t rootfs-$VERSION .
|
||||||
|
|
||||||
|
- name: Run rootfs bootstrap
|
||||||
|
run: |
|
||||||
|
VERSION=${{ matrix.version }}
|
||||||
|
OUTPUT_DIR=${{ env.OUTPUT_DIR }}/$VERSION
|
||||||
|
|
||||||
|
docker run --rm \
|
||||||
|
-v "$PWD/$OUTPUT_DIR:/output" \
|
||||||
|
rootfs-$VERSION \
|
||||||
|
bash -c "/scripts/bootstrap-rootfs.sh $VERSION /output"
|
||||||
|
|
||||||
|
# Verify tarball exists
|
||||||
|
TAR="$OUTPUT_DIR/debian-$VERSION.tar.bz2"
|
||||||
|
if [[ ! -f "$TAR" ]]; then
|
||||||
|
echo "[ERROR] Rootfs tarball missing: $TAR"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "[OK] Created $TAR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Clone upload repo
|
||||||
|
run: |
|
||||||
|
git clone --depth=1 \
|
||||||
|
https://${GIT_USERNAME}:${GIT_TOKEN}@gitea.fithwum.tech/fithwum/debian-base.git upload
|
||||||
|
|
||||||
|
- name: Update archive + sha256
|
||||||
|
run: |
|
||||||
|
VERSION=${{ matrix.version }}
|
||||||
|
OUTPUT_DIR=${{ env.OUTPUT_DIR }}/$VERSION
|
||||||
|
|
||||||
|
mkdir -p upload/$VERSION
|
||||||
|
cp "$OUTPUT_DIR/debian-$VERSION.tar.bz2" upload/$VERSION/
|
||||||
|
|
||||||
|
cd upload
|
||||||
|
# Remove old checksum for this version
|
||||||
|
sed -i "/debian-$VERSION.tar.bz2/d" sha256sums.txt 2>/dev/null || true
|
||||||
|
# Add new checksum
|
||||||
|
sha256sum "$VERSION/debian-$VERSION.tar.bz2" >> sha256sums.txt
|
||||||
|
|
||||||
|
- name: Commit if changed
|
||||||
|
run: |
|
||||||
|
VERSION=${{ matrix.version }}
|
||||||
|
|
||||||
|
cd upload
|
||||||
|
git config user.name "$GIT_USERNAME"
|
||||||
|
git config user.email "$GIT_EMAIL"
|
||||||
|
|
||||||
|
if git status --porcelain | grep .; then
|
||||||
|
git add "$VERSION/debian-$VERSION.tar.bz2" sha256sums.txt
|
||||||
|
git commit -m "Update rootfs for $VERSION [skip ci]"
|
||||||
|
git push
|
||||||
|
else
|
||||||
|
echo "[INFO] No changes for $VERSION"
|
||||||
|
|
||||||
# build-and-push-docker-images:
|
# build-and-push-docker-images:
|
||||||
# needs: build-and-push-rootfs-archives
|
# needs: build-and-push-rootfs-archives
|
||||||
# if: always()
|
# if: always()
|
||||||
@@ -284,67 +289,38 @@ jobs:
|
|||||||
# done
|
# done
|
||||||
|
|
||||||
build-and-push-docker-images:
|
build-and-push-docker-images:
|
||||||
needs: build-and-push-rootfs-archives
|
name: Build & Push Docker Images (${{ matrix.version }})
|
||||||
if: always()
|
needs: build-rootfs
|
||||||
runs-on: vm-docker-build2
|
runs-on: vm-docker-build2
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version: [bullseye, bookworm, trixie] # replace with your $VERSIONS
|
version: [bullseye, bookworm, trixie]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source
|
- name: Checkout source
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Wait for archives to appear in upload repo
|
- name: Prepare Docker context
|
||||||
run: |
|
run: |
|
||||||
echo "[INFO] Waiting for archive for ${{ matrix.version }}..."
|
VERSION=${{ matrix.version }}
|
||||||
mkdir -p temp-check && cd temp-check
|
OUTPUT_DIR=${{ env.OUTPUT_DIR }}/$VERSION
|
||||||
|
mkdir -p "$VERSION"
|
||||||
|
cp "$OUTPUT_DIR/debian-$VERSION.tar.bz2" "$VERSION/"
|
||||||
|
|
||||||
for i in {1..10}; do
|
- name: Generate Dockerfile
|
||||||
echo "[INFO] Attempt $i: Cloning upload-repo..."
|
|
||||||
if git clone --depth=1 "https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_TOKEN }}@gitea.fithwum.tech/fithwum/debian-base.git"; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
echo "[WARN] Clone failed. Retrying in 10s..."
|
|
||||||
sleep 10
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ! -d "debian-base" ]; then
|
|
||||||
echo "[ERROR] Failed to clone upload-repo after retries."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd debian-base
|
|
||||||
|
|
||||||
# Wait for this version's archive
|
|
||||||
for i in {1..30}; do
|
|
||||||
if [[ -f "${{ matrix.version }}/debian-${{ matrix.version }}.tar.bz2" ]]; then
|
|
||||||
echo "[OK] Found archive for ${{ matrix.version }}"
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo "[WAIT] ${{ matrix.version }} not ready yet, sleeping 10s..."
|
|
||||||
sleep 10
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ ! -f "${{ matrix.version }}/debian-${{ matrix.version }}.tar.bz2" ]]; then
|
|
||||||
echo "[ERROR] Missing archive for ${{ matrix.version }}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Generate Dockerfile for ${{ matrix.version }}
|
|
||||||
run: |
|
run: |
|
||||||
mkdir -p "${{ matrix.version }}"
|
VERSION=${{ matrix.version }}
|
||||||
DOCKERFILE_PATH="${{ matrix.version }}/Dockerfile"
|
DOCKERFILE="$VERSION/Dockerfile"
|
||||||
|
if [[ ! -f "$DOCKERFILE" ]]; then
|
||||||
if [[ ! -f "$DOCKERFILE_PATH" ]]; then
|
|
||||||
printf '%s\n' \
|
printf '%s\n' \
|
||||||
"FROM scratch" \
|
"FROM scratch" \
|
||||||
"LABEL maintainer=\"fithwum\"" \
|
"LABEL maintainer=\"fithwum\"" \
|
||||||
"ADD debian-${{ matrix.version }}.tar.bz2 /" \
|
"ADD debian-$VERSION.tar.bz2 /" \
|
||||||
"CMD [\"/bin/bash\"]" > "$DOCKERFILE_PATH"
|
"CMD [\"/bin/bash\"]" > "$DOCKERFILE"
|
||||||
echo "[INFO] Created $DOCKERFILE_PATH"
|
echo "[INFO] Created $DOCKERFILE"
|
||||||
else
|
else
|
||||||
echo "[INFO] Dockerfile already exists for ${{ matrix.version }}"
|
echo "[INFO] Dockerfile exists for $VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
@@ -353,14 +329,26 @@ jobs:
|
|||||||
- name: Log in to Gitea Registry
|
- name: Log in to Gitea Registry
|
||||||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login gitea.fithwum.tech -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login gitea.fithwum.tech -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
||||||
|
|
||||||
- name: Build and push Docker image for ${{ matrix.version }}
|
- name: Build & Push Docker Image
|
||||||
run: |
|
run: |
|
||||||
|
VERSION=${{ matrix.version }}
|
||||||
IMAGE_REGISTRY=gitea.fithwum.tech
|
IMAGE_REGISTRY=gitea.fithwum.tech
|
||||||
IMAGE_ORG=fithwum
|
IMAGE_ORG=fithwum
|
||||||
IMAGE_REPO=debian-base
|
IMAGE_REPO=debian-base
|
||||||
FULL_IMAGE="${IMAGE_REGISTRY}/${IMAGE_ORG}/${IMAGE_REPO}:${{ matrix.version }}"
|
FULL_IMAGE="$IMAGE_REGISTRY/$IMAGE_ORG/$IMAGE_REPO:$VERSION"
|
||||||
echo "[INFO] Building and pushing $FULL_IMAGE"
|
|
||||||
docker buildx build --platform linux/amd64 --push -t "$FULL_IMAGE" "./${{ matrix.version }}"
|
# 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 "${VERSION}/debian-$VERSION.tar.bz2" | 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:
|
generate-changelogs:
|
||||||
needs: build-and-push-rootfs-archives
|
needs: build-and-push-rootfs-archives
|
||||||
|
|||||||
Reference in New Issue
Block a user