From 4b0462b4be9060f18039f8aa41b0dc889c11dbde Mon Sep 17 00:00:00 2001 From: "Balasankar \"Balu\" C" Date: Tue, 5 Jul 2022 10:43:04 +0530 Subject: [PATCH] Support building PostgreSQL in UBI Signed-off-by: Balasankar "Balu" C --- scripts/install-postgresql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/install-postgresql b/scripts/install-postgresql index 4c655c4..8eeaf26 100755 --- a/scripts/install-postgresql +++ b/scripts/install-postgresql @@ -23,6 +23,20 @@ function build_debian() { rm -rf /var/lib/apt/lists/* } +function build_ubi() { + UBI_VERSION=$(lsb_release -a | awk '/Release/ { print $2 }') + UBI_MAJOR_VERSION=${UBI_VERSION%.*} # strip last component + + yum install -y "https://download.postgresql.org/pub/repos/yum/reporpms/EL-${UBI_MAJOR_VERSION}-x86_64/pgdg-redhat-repo-latest.noarch.rpm" + + yum update -y + + yum install -y postgresql${POSTGRES_VERSION} + + yum autoremove -y + yum clean -y all +} + BUILD_OS=${BUILD_OS:-debian} if [[ $BUILD_OS =~ debian ]]; then