mirror of
https://github.com/docker/docker-install.git
synced 2026-11-20 10:03:11 +03:00
When building the final install.sh script - fill the latest versions based on Github releases. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
30 lines
663 B
Bash
Executable File
30 lines
663 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
if [ $# -ne 1 ]; then
|
|
echo "Usage: $0 <stable|test>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
channel="$1"
|
|
|
|
last_release_tag() {
|
|
local field="$1"
|
|
gh -R moby/moby release list -O desc --json tagName,isLatest,isPrerelease \
|
|
-q ".[] | select(.${field}) | \
|
|
.tagName | \
|
|
sub(\"^docker-\"; \"\") | \
|
|
select(startswith(\"v\") == true) | \
|
|
sub(\"^v\"; \"\")" |
|
|
head -n1
|
|
}
|
|
|
|
case "$channel" in
|
|
stable) last_release_tag 'isLatest' ;;
|
|
test) last_release_tag 'isPrerelease' ;;
|
|
*)
|
|
echo "Error: Invalid channel '$channel'. Use 'stable' or 'test'." >&2
|
|
exit 1
|
|
;;
|
|
esac
|