Add GreptimeDB Alpine service packaging
All checks were successful
Build Alpine Packages / build-and-publish (push) Successful in 35m5s

This commit is contained in:
Joachim Schlöffel
2026-06-09 09:54:39 +02:00
parent f3ff86263a
commit 11ef6456af
19 changed files with 472 additions and 15 deletions

View File

@@ -5,6 +5,8 @@ repo_root="${REPO_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../.." &&
package_name="${PACKAGE_NAME:-greptimedb}"
alpine_version="${ALPINE_VERSION:-3.23}"
arch="${ALPINE_ARCH:-x86_64}"
repository_url="${ALPINE_REPOSITORY_URL:-}"
repository_key_url="${ALPINE_REPOSITORY_KEY_URL:-}"
case "${arch}" in
x86_64)
@@ -19,11 +21,11 @@ case "${arch}" in
;;
esac
if [[ "${SKIP_BUILD:-0}" != "1" ]]; then
if [[ -z "${repository_url}" && "${SKIP_BUILD:-0}" != "1" ]]; then
ALPINE_PACKAGE="${package_name}" "${repo_root}/scripts/apk/build.sh" build "${arch}"
fi
if [[ ! -d "${repo_root}/packages/local/${arch}" ]]; then
if [[ -z "${repository_url}" && ! -d "${repo_root}/packages/local/${arch}" ]]; then
printf 'missing local repository: packages/local/%s\n' "${arch}" >&2
printf 'run: ALPINE_PACKAGE=%s mise run apk:build\n' "${package_name}" >&2
exit 1
@@ -32,16 +34,35 @@ fi
docker run --rm --platform "${platform}" \
-e "ALPINE_ARCH=${arch}" \
-e "PACKAGE_NAME=${package_name}" \
-e "ALPINE_REPOSITORY_URL=${repository_url}" \
-e "ALPINE_REPOSITORY_KEY_URL=${repository_key_url}" \
-v "${repo_root}/packages/local:/repo:ro" \
"alpine:${alpine_version}" \
sh -lc '
set -e
cp "/repo/${ALPINE_ARCH}"/*.rsa.pub /etc/apk/keys/
printf "%s\n" /repo >> /etc/apk/repositories
if [ -n "${ALPINE_REPOSITORY_URL}" ]; then
if [ -n "${ALPINE_REPOSITORY_KEY_URL}" ]; then
apk add --no-cache curl >/dev/null
cd /etc/apk/keys
curl -fsSLOJ "${ALPINE_REPOSITORY_KEY_URL}"
fi
printf "%s\n" "${ALPINE_REPOSITORY_URL}" >> /etc/apk/repositories
else
cp "/repo/${ALPINE_ARCH}"/*.rsa.pub /etc/apk/keys/
printf "%s\n" /repo >> /etc/apk/repositories
fi
apk update
apk add "${PACKAGE_NAME}"
apk add \
"${PACKAGE_NAME}" \
"${PACKAGE_NAME}-datanode-openrc" \
"${PACKAGE_NAME}-flownode-openrc" \
"${PACKAGE_NAME}-frontend-openrc" \
"${PACKAGE_NAME}-metasrv-openrc" \
"${PACKAGE_NAME}-standalone-openrc"
test -x /usr/bin/greptime
greptime --version
ls -1 /etc/greptimedb
find /etc/init.d -maxdepth 1 -name "greptimedb.*" -print | sort
'