Skip to content

Commit 28d6607

Browse files
committed
Add arm64 support to all the latest "target" version images (currently *-to-17)
Also, convert `generate-stackbrew-library.sh` *fully* to `jq`: ```diff $ diff -u <(bashbrew cat https://github.com/tianon/bashbrew-tianon/raw/HEAD/library/postgres-upgrade) <(bashbrew cat <(./generate-stackbrew-library.sh)) --- /dev/fd/63 2025-08-28 20:09:44.520013765 -0700 +++ /dev/fd/62 2025-08-28 20:09:44.520013765 -0700 @@ -3,15 +3,19 @@ GitCommit: 6e41d05 Tags: 16-to-17 +Architectures: amd64, arm64v8 Directory: 16-to-17 Tags: 15-to-17 +Architectures: amd64, arm64v8 Directory: 15-to-17 Tags: 14-to-17 +Architectures: amd64, arm64v8 Directory: 14-to-17 Tags: 13-to-17 +Architectures: amd64, arm64v8 Directory: 13-to-17 Tags: 15-to-16 ```
1 parent 6e41d05 commit 28d6607

File tree

2 files changed

+34
-21
lines changed

2 files changed

+34
-21
lines changed

generate-stackbrew-library.jq

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"Maintainers: Tianon Gravi <[email protected]> (@tianon)",
2+
"GitRepo: https://github.com/tianon/docker-postgres-upgrade.git",
3+
"GitCommit: \($commit)",
4+
5+
(
6+
first(.[].new) as $newest
7+
8+
| to_entries[]
9+
10+
| if $ARGS.positional | length > 0 then
11+
select(IN(.key; $ARGS.positional[]))
12+
else . end
13+
14+
| (
15+
"",
16+
"Tags: \(.key)",
17+
"Directory: \(.key)",
18+
"Architectures: \(
19+
if .value.new == $newest then
20+
# only the newest (target) version gets more than one architecture
21+
# https://github.com/tianon/docker-postgres-upgrade/issues/99#issuecomment-3235566575
22+
"amd64, arm64v8"
23+
# TODO update "versions.sh" to also scrape/keep "Architectures" data from the upstream bashbrew files so this doesn't ever accidentally include things that don't exist or shouldn't be supported
24+
else "amd64" end
25+
)",
26+
empty
27+
)
28+
)

generate-stackbrew-library.sh

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
#!/usr/bin/env bash
22
set -Eeuo pipefail
33

4-
self="$(basename "$BASH_SOURCE")"
54
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
65

7-
if [ "$#" -eq 0 ]; then
8-
versions="$(jq -r 'keys_unsorted | map(@sh) | join(" ")' versions.json)"
9-
eval "set -- $versions"
10-
fi
11-
126
commit="$(git log -1 --format='format:%H' HEAD)"
137

14-
cat <<-EOH
15-
Maintainers: Tianon Gravi <[email protected]> (@tianon)
16-
GitRepo: https://github.com/tianon/docker-postgres-upgrade.git
17-
GitCommit: $commit
18-
EOH
19-
20-
for version; do
21-
export version
22-
23-
cat <<-EOE
24-
25-
Tags: $version
26-
Directory: $version
27-
EOE
28-
done
8+
exec jq \
9+
--raw-output \
10+
--arg commit "$commit" \
11+
--from-file generate-stackbrew-library.jq \
12+
versions.json \
13+
--args -- "$@"

0 commit comments

Comments
 (0)