From 5670e4bedadffc96d0d02c118c74405f546f5472 Mon Sep 17 00:00:00 2001 From: Owen Ou Date: Tue, 26 Sep 2023 14:37:34 -0700 Subject: [PATCH] Use pgxman installer script Use pgxman installer script --- Dockerfile | 6 ++-- Dockerfile.spilo | 4 +-- third-party/pgxman/install.sh | 55 ----------------------------------- 3 files changed, 3 insertions(+), 62 deletions(-) delete mode 100755 third-party/pgxman/install.sh diff --git a/Dockerfile b/Dockerfile index 429e18e9..c05b1c9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,5 @@ ARG POSTGRES_BASE_VERSION # Always force rebuild of this layer ARG TIMESTAMP=1 COPY third-party/pgxman /tmp/pgxman/ -RUN set -eux; \ - /tmp/pgxman/install.sh /tmp/pgxman/pgxman_${POSTGRES_BASE_VERSION}.yaml; \ - pgxman install pgsql-http=1.5.0@${POSTGRES_BASE_VERSION}; \ - rm -rf /tmp/pgxman +RUN curl -sfL https://github.com/pgxman/release/releases/latest/download/install.sh | sh -s -- /tmp/pgxman/pgxman_${POSTGRES_BASE_VERSION}.yaml && \ + pgxman install pgsql-http=1.5.0@${POSTGRES_BASE_VERSION} --yes diff --git a/Dockerfile.spilo b/Dockerfile.spilo index c6cbeaac..8ff07108 100644 --- a/Dockerfile.spilo +++ b/Dockerfile.spilo @@ -28,6 +28,4 @@ ENV PGVERSION=${POSTGRES_BASE_VERSION} SPILO_PROVIDER=local PGUSER_SUPERUSER=pos # Always force rebuild of this layer ARG TIMESTAMP=1 COPY third-party/pgxman /tmp/pgxman/ -RUN set -eux; \ - /tmp/pgxman/install.sh /tmp/pgxman/pgxman_13.yaml /tmp/pgxman/pgxman_14_spilo.yaml; \ - rm -rf /tmp/pgxman +RUN curl -sfL https://github.com/pgxman/release/releases/latest/download/install.sh | sh -s -- /tmp/pgxman/pgxman_13.yaml /tmp/pgxman/pgxman_14_spilo.yaml diff --git a/third-party/pgxman/install.sh b/third-party/pgxman/install.sh deleted file mode 100755 index cc59ff12..00000000 --- a/third-party/pgxman/install.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -main() { - install_pgxman - - for _file in "$@"; do - echo "Installing extensions from ${_file}..." - pgxman install --file "$_file" || exit 1 - done -} - -install_pgxman() { - get_architecture || return 1 - local _arch="$RETVAL" - - echo "Installing PGXMan for ${_arch}..." - - curl --silent --show-error --fail --location "https://github.com/pgxman/release/releases/latest/download/pgxman_linux_${_arch}.deb" --output "/tmp/pgxman_linux_${_arch}.deb" - apt update - apt install -y "/tmp/pgxman_linux_${_arch}.deb" - pgxman update -} - -get_architecture() { - local _cputype _arch - _cputype="$(uname -m)" - - case "$_cputype" in - i386 | i486 | i686 | i786 | x86) - _cputype=386 - ;; - - xscale | arm | armv6l | armv7l | armv8l) - _cputype=arm - ;; - - aarch64 | arm64) - _cputype=arm64 - ;; - - x86_64 | x86-64 | x64 | amd64) - _cputype=amd64 - ;; - - *) - err "unknown CPU type: $_cputype" - ;; - esac - - RETVAL="$_cputype" -} - -main "$@" || exit 1