ci: skip published image versions and share one sanity ignore list
image.yml: when the version tag is already in the registry the job now ends without building, instead of rebuilding under sha-* and latest. A new version is pushed as <version> and latest; the sha-* tag is gone, so one digest belongs to exactly one version. build.yml: ansible-test reads tests/sanity/ignore-<core MAJOR.MINOR>.txt, so every core bump needed a new file. The committed list is now ignore-common.txt, copied to the installed core's file name inside the throwaway worktree (a committed ignore-<MAJOR.MINOR>.txt is appended). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
569b7bbe15
commit
fd4c04d095
5 files changed
+33
-18
No files matched your search
+14
-13
@@ -61,8 +61,9 @@ jobs:
|
||||
#
|
||||
# version: the semver tag of the image, independent of the Collection's releases.
|
||||
# Bump it in the same PR as an image change you want to publish under a new tag.
|
||||
# A version that is already in the registry is never moved (see the prepare step):
|
||||
# such a build is tagged sha-<12> and latest only. Pin consumers as
|
||||
# A version that is already in the registry is never moved and never rebuilt (see the
|
||||
# prepare step): that job ends without building, so every digest belongs to exactly one
|
||||
# version tag. A new version is pushed as <version> and latest. Pin consumers as
|
||||
# image:<version>@sha256:<digest>; the digest is what is enforced.
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -266,18 +267,19 @@ jobs:
|
||||
export SSL_CERT_DIR=/kaniko/ssl/certs
|
||||
registry="${SERVER_URL#https://}"
|
||||
image="${registry}/${IMAGE_PATH}"
|
||||
short="${SHA:0:12}"
|
||||
|
||||
# /kaniko is removed when the build finishes, so read the marker now.
|
||||
dests=(--destination "${image}:sha-${short}" --destination "${image}:latest")
|
||||
version_new=true
|
||||
# /kaniko is removed when the build finishes, so read the marker now. A published
|
||||
# version is neither moved nor rebuilt: an image whose inputs changed needs a new
|
||||
# version (Lint enforces it), and a rebuild of unchanged inputs would only give the
|
||||
# same tag a second digest.
|
||||
if [ -e /kaniko/version-published ]; then
|
||||
version_new=false
|
||||
echo "::warning::${image}:${IMAGE_VERSION} is already published and is not moved;" \
|
||||
"bump the version in image.yml to release this build under a new tag."
|
||||
else
|
||||
dests+=(--destination "${image}:${IMAGE_VERSION}")
|
||||
echo "${image}:${IMAGE_VERSION} is already published; nothing to build."
|
||||
if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
|
||||
echo "${IMAGE_PATH}:${IMAGE_VERSION} is already published; skipped." >> "$GITHUB_STEP_SUMMARY" || true
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
dests=(--destination "${image}:${IMAGE_VERSION}" --destination "${image}:latest")
|
||||
|
||||
# Context: this commit of this repository, cloned by kaniko (#<ref>#<sha>:
|
||||
# clone <ref>, check out <sha>). With a sub-path only that directory is the
|
||||
@@ -311,8 +313,7 @@ jobs:
|
||||
echo "::error::kaniko finished but no pushed image digest was found in its output."
|
||||
exit 1
|
||||
fi
|
||||
ref="${image}@${digest}"
|
||||
if [ "$version_new" = true ]; then ref="${image}:${IMAGE_VERSION}@${digest}"; fi
|
||||
ref="${image}:${IMAGE_VERSION}@${digest}"
|
||||
echo "Pinned reference: ${ref}"
|
||||
if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user