2022-11-20 00:38:24 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
version=${1}
|
|
|
|
type=${2}
|
|
|
|
date=${3:-$(date +%Y%m%d)}
|
|
|
|
revision=${4:-0}
|
|
|
|
|
|
|
|
major=${1:0:1}
|
|
|
|
minor=${1:2:1}
|
|
|
|
|
|
|
|
usage() {
|
2023-05-16 03:18:43 +00:00
|
|
|
printf "%s: RELEASE TYPE [DATE]\n\n" $0
|
|
|
|
log "$1"
|
2022-11-20 00:38:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# shellcheck disable=SC2046,1091,1090
|
|
|
|
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
|
|
|
|
|
|
|
name="Rocky-${version}.${date}-${type}"
|
|
|
|
|
|
|
|
arches=(x86_64 aarch64)
|
2022-11-29 04:05:03 +00:00
|
|
|
set -x
|
2022-11-20 00:38:24 +00:00
|
|
|
if [[ $major -ge 9 ]]; then
|
2023-05-16 03:18:43 +00:00
|
|
|
arches=(${arches[@]} s390x ppc64le)
|
2022-11-20 00:38:24 +00:00
|
|
|
fi
|
|
|
|
|
2023-05-16 03:18:43 +00:00
|
|
|
case $type in
|
|
|
|
UBI | Minimal)
|
|
|
|
suffix="-${type,,}"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
suffix=''
|
|
|
|
;;
|
2022-11-20 00:38:24 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
declare -A shasums
|
|
|
|
|
|
|
|
for a in "${arches[@]}"; do
|
2023-05-16 03:18:43 +00:00
|
|
|
pt="${name}-${a}"
|
|
|
|
if has-branch $pt; then
|
|
|
|
shasums[$a]="$(git rev-parse $pt)"
|
|
|
|
fi
|
2022-11-20 00:38:24 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
cat <<EOF
|
2023-05-16 03:18:43 +00:00
|
|
|
Tags: ${version}.${date}${suffix}, ${version}${suffix}, ${major}${suffix}
|
2022-11-20 00:38:24 +00:00
|
|
|
GitFetch: refs/heads/${name}-x86_64
|
|
|
|
GitCommit: ${shasums[x86_64]}
|
|
|
|
arm64v8-GitFetch: refs/heads/${name}-aarch64
|
|
|
|
arm64v8-GitCommit: ${shasums[aarch64]}
|
2022-11-29 04:05:03 +00:00
|
|
|
s390x-GitFetch: refs/heads/${name}-s390x
|
|
|
|
s390x-GitCommit: ${shasums[s390x]}
|
|
|
|
ppc64le-GitFetch: refs/heads/${name}-ppc64le
|
|
|
|
ppc64le-GitCommit: ${shasums[ppc64le]}
|
|
|
|
Architectures: amd64, arm64v8, ppc64le, s390x
|
2022-11-20 00:38:24 +00:00
|
|
|
EOF
|