Skip to content

Commit

Permalink
Install wal-g from a precompiled bin (#1006)
Browse files Browse the repository at this point in the history
- decrease build time
- fix the problem of missing brotli compression type after upgrade to WAL-G v3
  • Loading branch information
hughcapet authored Jul 23, 2024
1 parent 17f59f6 commit d12e65a
Showing 1 changed file with 12 additions and 26 deletions.
38 changes: 12 additions & 26 deletions postgres-appliance/build_scripts/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,22 @@ MAKEFLAGS="-j $(grep -c ^processor /proc/cpuinfo)"
export MAKEFLAGS
ARCH="$(dpkg --print-architecture)"

# 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

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
PKG_NAME='wal-g-pg-ubuntu-20.04-amd64'
else
PKG_NAME='wal-g-pg-ubuntu20.04-aarch64'
fi

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

0 comments on commit d12e65a

Please sign in to comment.