Skip to content

Commit

Permalink
Merge pull request #65 from vicamo/for-myself/add-versioned-tags
Browse files Browse the repository at this point in the history
feat: add versioned tags
  • Loading branch information
vicamo authored May 12, 2024
2 parents 0220251 + ca32d5c commit 9341d30
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/per-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ jobs:
labels+=(--label "${line}")
done <<<"${DOCKER_METADATA_OUTPUT_LABELS}"
version=
for flavor in "" slim; do
digests=()
Expand All @@ -224,6 +225,19 @@ jobs:
fi
fi
if [ -z "${version}" ]; then
version=$(< "${context_dir}/rootfs.debian_version")
fi
if [[ "${version}" =~ [0-9]+\.[0-9]+ ]]; then
ver="${version}"
while [ -n "${ver}" ]; do
tags+=(--tag "${REPOSITORY}:${ver}-${arch}${flavor:+-${flavor}}")
[ "${ver}" != "${ver%.*}" ] || break
ver="${ver%.*}"
done
fi
if ! (printf "FROM scratch\nADD rootfs.tar.xz /\nCMD [\"/bin/bash\"]" | \
docker buildx build "${load_or_push}" \
--platform "${platform}" \
Expand Down Expand Up @@ -264,6 +278,16 @@ jobs:
fi
fi
if [[ "${version}" =~ [0-9]+\.[0-9]+ ]]; then
ver="${version}"
while [ -n "${ver}" ]; do
tags+=(--tag "${REPOSITORY}:${ver}${flavor:+-${flavor}}")
[ "${ver}" != "${ver%.*}" ] || break
ver="${ver%.*}"
done
fi
${DRY_RUN:+echo} docker buildx imagetools create \
"${tags[@]}" "${index_annotations[@]}" "${digests[@]}"
Expand Down

0 comments on commit 9341d30

Please sign in to comment.