Update SeaweedFS and add outdated checks
Build Alpine Packages / build-and-publish (v3.24, 3.24) (push) Has been cancelled
Build Alpine Packages / build-and-publish (v3.24, 3.24) (push) Has been cancelled
This commit is contained in:
@@ -1,15 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="${REPO_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../.." && pwd)}"
|
||||
package_dir="${PACKAGE_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
|
||||
configs=(credential filer master notification replication security shell)
|
||||
pkgver="$(
|
||||
awk -F= '$1 == "pkgver" { print $2; exit }' "${package_dir}/APKBUILD"
|
||||
)"
|
||||
tmpdir="$(mktemp -d)"
|
||||
|
||||
cleanup() {
|
||||
rm -rf "${tmpdir}"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
case "$(uname -m)" in
|
||||
x86_64)
|
||||
archive="linux_amd64.tar.gz"
|
||||
;;
|
||||
aarch64|arm64)
|
||||
archive="linux_arm64.tar.gz"
|
||||
;;
|
||||
*)
|
||||
printf 'unsupported host architecture for SeaweedFS generated sources: %s\n' "$(uname -m)" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
curl -fsSL \
|
||||
-o "${tmpdir}/${archive}" \
|
||||
"https://github.com/seaweedfs/seaweedfs/releases/download/${pkgver}/${archive}"
|
||||
tar -xzf "${tmpdir}/${archive}" -C "${tmpdir}" weed
|
||||
|
||||
for config in "${configs[@]}"; do
|
||||
"${repo_root}/bin/weed" scaffold -config "${config}" 2>/dev/null \
|
||||
"${tmpdir}/weed" scaffold -config "${config}" 2>/dev/null \
|
||||
> "${package_dir}/example-${config}.toml"
|
||||
done
|
||||
|
||||
"${repo_root}/bin/weed" autocomplete bash 2>/dev/null \
|
||||
"${tmpdir}/weed" autocomplete bash 2>/dev/null \
|
||||
| sed -E 's#complete -C "?[^"]*/weed"? weed#complete -C /usr/bin/weed weed#' \
|
||||
> "${package_dir}/weed.bash-completion"
|
||||
|
||||
Reference in New Issue
Block a user