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: |
|
||||
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: |
|
||||
cd upload-repo
|
||||
|
||||
for version in buster bullseye bookworm docker-build; do
|
||||
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"
|
||||
infofile="$version/build-info.json"
|
||||
|
||||
jq -n \
|
||||
--arg version "$version" \
|
||||
--arg commit "$(git rev-parse HEAD)" \
|
||||
--arg build_time "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
||||
--arg image_tag "$IMAGE" \
|
||||
--arg digest "$DIGEST" \
|
||||
'{
|
||||
version: $version,
|
||||
commit: $commit,
|
||||
build_time: $build_time,
|
||||
image_tag: $image_tag,
|
||||
image_digest: $digest
|
||||
}' > "$infofile"
|
||||
digest=$(docker inspect --format='{{index .RepoDigests 0}}' "gitea.fithwum.tech/fithwum/debian-base:$version" || echo "unknown")
|
||||
base_os=$(lsb_release -d 2>/dev/null | cut -f2 || echo "unknown")
|
||||
kernel=$(uname -r)
|
||||
arch=$(uname -m)
|
||||
|
||||
jq -n --arg version "$version" \
|
||||
--arg commit "$(git rev-parse HEAD)" \
|
||||
--arg build_time "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
||||
--arg image_tag "gitea.fithwum.tech/fithwum/debian-base:$version" \
|
||||
--arg digest "$digest" \
|
||||
--arg base_os "$base_os" \
|
||||
--arg kernel "$kernel" \
|
||||
--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
|
||||
|
||||
- name: Commit and push build-info if changed
|
||||
|
||||
Reference in New Issue
Block a user