Skip to content

Commit d7ea7a9

Browse files
obnoxxxmergify[bot]
authored andcommitted
hack: add release script to generate download info
This extracts a script from the release process document. This script can be invoked to create the downloads section for the release notes for a given release. Signed-off-by: Michael Adam <[email protected]>
1 parent 2e5ddc0 commit d7ea7a9

File tree

2 files changed

+46
-38
lines changed

2 files changed

+46
-38
lines changed

docs/release-process.md

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -105,46 +105,17 @@ on GitHub (beyond the sources automatically provided there). Instead we add
105105
a Downloads section that notes the exact tags and digests that the images can
106106
be found at on quay.io.
107107

108-
The downloads section can be generated using the following shell script:
109-
```bash
110-
#!/usr/bin/env bash
111-
# Requires `skopeo` and `jq` to be installed.
112-
113-
set -e
114-
115-
sk_digest() {
116-
skopeo inspect "docker://${1}" | jq -r .Digest
117-
}
118-
119-
image_info() {
120-
curr_img="quay.io/samba.org/${1}:${2}"
121-
digest=$(sk_digest "${curr_img}")
122-
# strip preN from tag name
123-
final_tag="$(echo "$2" | sed 's,pre[0-9]*$,,')"
124-
tag_img="quay.io/samba.org/${1}:${final_tag}"
125-
dst_img="quay.io/samba.org/${1}@${digest}"
126-
127-
echo "### $1"
128-
echo "* By tag: $tag_img"
129-
echo "* By digest: $dst_img"
130-
echo ""
131-
}
132-
133-
wip_tag=$1
134-
if [ -z "${wip_tag}" ] ; then
135-
echo "No tag provided!" >&2
136-
exit 1
137-
fi
138-
139-
echo "## Downloads"
140-
echo ""
141-
echo "Images built for this release can be acquired from the quay.io image registry."
142-
echo ""
143-
for component in samba-server samba-ad-server samba-client samba-toolbox; do
144-
image_info "${component}" "${wip_tag}"
145-
done
108+
The downloads section can be generated using the shell script
109+
https://github.com/samba-in-kubernetes/samba-container/blob/master/hack/install-tools.sh in this repository.
110+
111+
It needs to be invoked with the release tag as the only argument. E. G. :
112+
113+
```console
114+
115+
$ ./hack/release-gen-download-section.sh v0.3
146116
```
147117

118+
148119
It is important that the digest is fetched from qauy.io after it has been
149120
pushed. Do not use any local digest hashes. You may want to double check the
150121
values produced by the script with those in the quay.io UI. Click on the

hack/release-gen-download-section.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
# Requires `skopeo` and `jq` to be installed.
3+
4+
set -e
5+
6+
sk_digest() {
7+
skopeo inspect "docker://${1}" | jq -r .Digest
8+
}
9+
10+
image_info() {
11+
curr_img="quay.io/samba.org/${1}:${2}"
12+
digest=$(sk_digest "${curr_img}")
13+
# strip preN from tag name
14+
final_tag=${2/%pre[0-9]*/}
15+
tag_img="quay.io/samba.org/${1}:${final_tag}"
16+
dst_img="quay.io/samba.org/${1}@${digest}"
17+
18+
echo "### $1"
19+
echo "* By tag: $tag_img"
20+
echo "* By digest: $dst_img"
21+
echo ""
22+
}
23+
24+
wip_tag=$1
25+
if [ -z "${wip_tag}" ] ; then
26+
echo "No tag provided!" >&2
27+
exit 1
28+
fi
29+
30+
echo "## Downloads"
31+
echo ""
32+
echo "Images built for this release can be acquired from the quay.io image registry."
33+
echo ""
34+
for component in samba-server samba-ad-server samba-client samba-toolbox; do
35+
image_info "${component}" "${wip_tag}"
36+
done
37+

0 commit comments

Comments
 (0)