Build Alpine Packages / preflight (pull_request) Successful in 20s
Build Alpine Packages / build (gitea) (pull_request) Successful in 15s
Build Alpine Packages / build (lavinmq) (pull_request) Successful in 3m30s
Build Alpine Packages / build (seaweedfs) (pull_request) Successful in 29m27s
Build Alpine Packages / build (greptimedb) (pull_request) Successful in 56m19s
Build Alpine Packages / verify-and-publish (pull_request) Successful in 1m31s
39 lines
1.2 KiB
Bash
Executable File
39 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
package_dir="${PACKAGE_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
|
|
configs=(admin credential filer master volume notification replication security shell)
|
|
pkgver="$(
|
|
awk -F= '$1 == "pkgver" { print $2; exit }' "${package_dir}/APKBUILD"
|
|
)"
|
|
tmpdir="$(mktemp -d)"
|
|
repo_root="${REPO_ROOT:-$(cd "${package_dir}/../../../.." && pwd)}"
|
|
source_archive="${repo_root}/.cache/apk-distfiles/seaweedfs-${pkgver}-src.tar.gz"
|
|
|
|
cleanup() {
|
|
rm -rf "${tmpdir}"
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
if [[ ! -f "${source_archive}" ]]; then
|
|
source_archive="${tmpdir}/seaweedfs-${pkgver}-src.tar.gz"
|
|
curl -fsSL \
|
|
-o "${source_archive}" \
|
|
"https://github.com/seaweedfs/seaweedfs/archive/refs/tags/${pkgver}.tar.gz"
|
|
fi
|
|
tar -xzf "${source_archive}" -C "${tmpdir}"
|
|
source_dir="${tmpdir}/seaweedfs-${pkgver}"
|
|
(
|
|
cd "${source_dir}"
|
|
go build -mod=readonly -buildvcs=false -trimpath -o "${tmpdir}/weed" ./weed
|
|
)
|
|
|
|
for config in "${configs[@]}"; do
|
|
"${tmpdir}/weed" scaffold -config "${config}" 2>/dev/null \
|
|
> "${package_dir}/example-${config}.toml"
|
|
done
|
|
|
|
"${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"
|