diff --git a/docs/release-process.md b/docs/release-process.md index a081982..ab125b1 100644 --- a/docs/release-process.md +++ b/docs/release-process.md @@ -105,46 +105,17 @@ on GitHub (beyond the sources automatically provided there). Instead we add a Downloads section that notes the exact tags and digests that the images can be found at on quay.io. -The downloads section can be generated using the following shell script: -```bash -#!/usr/bin/env bash -# Requires `skopeo` and `jq` to be installed. - -set -e - -sk_digest() { - skopeo inspect "docker://${1}" | jq -r .Digest -} - -image_info() { - curr_img="quay.io/samba.org/${1}:${2}" - digest=$(sk_digest "${curr_img}") - # strip preN from tag name - final_tag="$(echo "$2" | sed 's,pre[0-9]*$,,')" - tag_img="quay.io/samba.org/${1}:${final_tag}" - dst_img="quay.io/samba.org/${1}@${digest}" - - echo "### $1" - echo "* By tag: $tag_img" - echo "* By digest: $dst_img" - echo "" -} - -wip_tag=$1 -if [ -z "${wip_tag}" ] ; then - echo "No tag provided!" >&2 - exit 1 -fi - -echo "## Downloads" -echo "" -echo "Images built for this release can be acquired from the quay.io image registry." -echo "" -for component in samba-server samba-ad-server samba-client samba-toolbox; do - image_info "${component}" "${wip_tag}" -done +The downloads section can be generated using the shell script +https://github.com/samba-in-kubernetes/samba-container/blob/master/hack/install-tools.sh in this repository. + +It needs to be invoked with the release tag as the only argument. E. G. : + +```console + +$ ./hack/release-gen-download-section.sh v0.3 ``` + It is important that the digest is fetched from qauy.io after it has been pushed. Do not use any local digest hashes. You may want to double check the values produced by the script with those in the quay.io UI. Click on the diff --git a/hack/release-gen-download-section.sh b/hack/release-gen-download-section.sh new file mode 100755 index 0000000..2fb6069 --- /dev/null +++ b/hack/release-gen-download-section.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# Requires `skopeo` and `jq` to be installed. + +set -e + +sk_digest() { + skopeo inspect "docker://${1}" | jq -r .Digest +} + +image_info() { + curr_img="quay.io/samba.org/${1}:${2}" + digest=$(sk_digest "${curr_img}") + # strip preN from tag name + final_tag=${2/%pre[0-9]*/} + tag_img="quay.io/samba.org/${1}:${final_tag}" + dst_img="quay.io/samba.org/${1}@${digest}" + + echo "### $1" + echo "* By tag: $tag_img" + echo "* By digest: $dst_img" + echo "" +} + +wip_tag=$1 +if [ -z "${wip_tag}" ] ; then + echo "No tag provided!" >&2 + exit 1 +fi + +echo "## Downloads" +echo "" +echo "Images built for this release can be acquired from the quay.io image registry." +echo "" +for component in samba-server samba-ad-server samba-client samba-toolbox; do + image_info "${component}" "${wip_tag}" +done +