Skip to content

Commit

Permalink
Install wal-g from a precompiled bin
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcapet committed Jul 22, 2024
1 parent 17f59f6 commit d52b72b
Showing 1 changed file with 13 additions and 27 deletions.
40 changes: 13 additions & 27 deletions postgres-appliance/build_scripts/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,24 @@ fi
export DEBIAN_FRONTEND=noninteractive
MAKEFLAGS="-j $(grep -c ^processor /proc/cpuinfo)"
export MAKEFLAGS
ARCH="$(dpkg --print-architecture)"
ARCH=$(uname -m)

# We want to remove all libgdal30 debs except one that is for current architecture.
printf "shopt -s extglob\nrm /builddeps/!(*_%s.deb)" "$(dpkg --print-architecture)" | bash -s

echo -e 'APT::Install-Recommends "0";\nAPT::Install-Suggests "0";' > /etc/apt/apt.conf.d/01norecommend

apt-get update
apt-get install -y curl ca-certificates

apt-get install -y software-properties-common gpg-agent
add-apt-repository ppa:longsleep/golang-backports
apt-get update
apt-get install -y golang-go liblzo2-dev brotli libsodium-dev git make cmake gcc libc-dev
go version

git clone -b "$WALG_VERSION" --recurse-submodules https://github.com/wal-g/wal-g.git
cd /wal-g
go get -v -t -d ./...
go mod vendor

bash link_brotli.sh

sed -i -e 's/1.0.17/1.0.18/g' link_libsodium.sh
sed -i -e "s/download\/\$LIBSODIUM_VERSION/download\/\$LIBSODIUM_VERSION-RELEASE/g" link_libsodium.sh

bash link_libsodium.sh

export USE_LIBSODIUM=1
export USE_LZO=1
make pg_build

# We want to remove all libgdal30 debs except one that is for current architecture.
printf "shopt -s extglob\nrm /builddeps/!(*_%s.deb)" "$ARCH" | bash -s

mkdir /builddeps/wal-g

cp /wal-g/main/pg/wal-g /builddeps/wal-g/
if [ "$ARCH" = "amd64" ]; then
DISTRIB_RELEASE='ubuntu-20.04'
else
DISTRIB_RELEASE='ubuntu20.04'
fi

curl -sL "https://github.com/wal-g/wal-g/releases/download/$WALG_VERSION/wal-g-pg-$DISTRIB_RELEASE-$ARCH.tar.gz" \
| tar -C /builddeps/wal-g -xz
mv "/builddeps/wal-g/wal-g-pg-$DISTRIB_RELEASE-$ARCH" /builddeps/wal-g/wal-g

0 comments on commit d52b72b

Please sign in to comment.