Files
Gleb Popov 1f41c766af Fix scripts/build.sh to work on RedHat-based distros
On CentOS and other RH-based distros the output of "go version" contains the "(Red Hat 1.26.2-2.el10)" string, which confuses the parser.
2026-05-15 09:04:32 +03:00

29 lines
802 B
Bash
Executable File

#!/bin/bash
# build.sh
#
# This script builds doltgres from source for this machine's OS and architecture.
# Requires a locally running docker server.
set -e
set -o pipefail
script_dir=$(dirname "$0")
cd $script_dir/..
go_version=`go version | cut -d" " -f 3 | sed -e 's|go||' | sed -e 's|\.[0-9]$||'`
os=`go version | sed "s| (.*)||" | cut -d" " -f 4 | sed "s|/.*||"`
arch=`go version | sed "s| (.*)||" | cut -d" " -f 4 | sed "s|.*/||"`
echo "os is $os"
echo "arch is $arch"
echo "go version is $go_version"
# Run the build script in docker, using the current working directory as the docker src
# directory. Packaged binaries will be placed in out/
docker run --rm \
-v `pwd`:/src \
-w /src \
golang:"$go_version"-trixie \
/src/scripts/build_binaries.sh "$os-$arch"