update
Some checks failed
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / push-archives-to-repo (push) Has been cancelled
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / build-and-push-docker-images (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. / build-rootfs-archives (push) Has been cancelled
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. / push-archives-to-repo (push) Has been cancelled
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / build-and-push-docker-images (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. / build-rootfs-archives (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:
@@ -178,35 +178,37 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git clone "https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_TOKEN }}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo
|
git clone "https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_TOKEN }}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo
|
||||||
|
|
||||||
- name: Generate build-info.json per version with digest
|
- name: Generate build-info.json per version
|
||||||
run: |
|
run: |
|
||||||
cd upload-repo
|
cd upload-repo
|
||||||
|
|
||||||
for version in buster bullseye bookworm docker-build; do
|
for version in buster bullseye bookworm docker-build; do
|
||||||
echo "[INFO] Generating build-info.json for $version"
|
echo "[INFO] Generating build-info.json for $version"
|
||||||
|
|
||||||
# Try to get digest from Docker registry for the pushed image
|
|
||||||
IMAGE="gitea.fithwum.tech/fithwum/debian-base:$version"
|
|
||||||
|
|
||||||
# Pull metadata with buildx imagetools inspect (you can also use docker inspect or API)
|
|
||||||
DIGEST=$(docker buildx imagetools inspect "$IMAGE" --raw | jq -r '.manifests[0].digest' 2>/dev/null || echo "unknown")
|
|
||||||
|
|
||||||
mkdir -p "$version"
|
mkdir -p "$version"
|
||||||
infofile="$version/build-info.json"
|
infofile="$version/build-info.json"
|
||||||
|
|
||||||
jq -n \
|
digest=$(docker inspect --format='{{index .RepoDigests 0}}' "gitea.fithwum.tech/fithwum/debian-base:$version" || echo "unknown")
|
||||||
--arg version "$version" \
|
base_os=$(lsb_release -d 2>/dev/null | cut -f2 || echo "unknown")
|
||||||
--arg commit "$(git rev-parse HEAD)" \
|
kernel=$(uname -r)
|
||||||
--arg build_time "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
arch=$(uname -m)
|
||||||
--arg image_tag "$IMAGE" \
|
|
||||||
--arg digest "$DIGEST" \
|
jq -n --arg version "$version" \
|
||||||
'{
|
--arg commit "$(git rev-parse HEAD)" \
|
||||||
version: $version,
|
--arg build_time "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
||||||
commit: $commit,
|
--arg image_tag "gitea.fithwum.tech/fithwum/debian-base:$version" \
|
||||||
build_time: $build_time,
|
--arg digest "$digest" \
|
||||||
image_tag: $image_tag,
|
--arg base_os "$base_os" \
|
||||||
image_digest: $digest
|
--arg kernel "$kernel" \
|
||||||
}' > "$infofile"
|
--arg arch "$arch" \
|
||||||
|
'{
|
||||||
|
version: $version,
|
||||||
|
commit: $commit,
|
||||||
|
build_time: $build_time,
|
||||||
|
image_tag: $image_tag,
|
||||||
|
digest: $digest,
|
||||||
|
base_os: $base_os,
|
||||||
|
kernel: $kernel,
|
||||||
|
arch: $arch
|
||||||
|
}' > "$infofile"
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Commit and push build-info if changed
|
- name: Commit and push build-info if changed
|
||||||
|
|||||||
Reference in New Issue
Block a user