2026-09-23 15:19:50

This commit is contained in:
support committed 2026-09-23 17:19:50 +02:00
1 parent e808725578
commit 5ea2bdbed7
12 files changed
+642

No files matched your search

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -Eeuo pipefail
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=install_common.sh
source "$SCRIPT_DIR/install_common.sh"
readonly STAGING_DIR="${STAGING_DIR:-/app/staging_area/copilot/tmp}"
readonly POSTGRES_ROOT="${POSTGRES_ROOT:-/app/postgres/rdbms}"
readonly PG_REPACK_REPOSITORY="${PG_REPACK_REPOSITORY:-reorg/pg_repack}"
[[ $# -eq 1 ]] || die "Usage: $0 <postgresql-version>"
readonly POSTGRES_VERSION="$1"
validate_postgresql_version "$POSTGRES_VERSION"
require_tools curl tar make
readonly PREFIX="$POSTGRES_ROOT/$POSTGRES_VERSION"
readonly PG_CONFIG="$PREFIX/bin/pg_config"
require_postgresql_installation "$PREFIX"
reset_staging_dir "$STAGING_DIR"
readonly PG_REPACK_TAG="${PG_REPACK_TAG:-$(latest_tag "$PG_REPACK_REPOSITORY")}"
[[ -n "$PG_REPACK_TAG" ]] || die "could not determine the latest pg_repack release"
readonly PG_REPACK_DIR="$STAGING_DIR/pg_repack-${PG_REPACK_TAG}"
printf 'Building pg_repack %s\n' "$PG_REPACK_TAG"
download_source "$STAGING_DIR" "$PG_REPACK_REPOSITORY" "$PG_REPACK_TAG" \
"pg_repack-${PG_REPACK_TAG}.tar.gz" "$PG_REPACK_DIR"
cd "$PG_REPACK_DIR"
make -j"${JOBS:-$(nproc)}" PG_CONFIG="$PG_CONFIG"
make install PG_CONFIG="$PG_CONFIG"
test -x "$PREFIX/bin/pg_repack"
test -f "$PREFIX/share/extension/pg_repack.control"