1
0
Fork 0

Refactor release utilities

master
Philip O'Toole 1 year ago
parent 2f2b36e51d
commit a358612fc1

@ -52,14 +52,8 @@ fi
# Create work directories
tmp_build=`mktemp -d`
tmp_pkg=`mktemp -d`
tmp_musl_pkg=`mktemp -d`
tmp_linux_arm64_pkg=`mktemp -d`
tmp_linux_arm_pkg=`mktemp -d`
echo "$tmp_build created for build process."
echo "$tmp_pkg created for packaging process."
echo "$tmp_musl_pkg created for musl packaging process."
echo "$tmp_linux_arm64_pkg created for Linux ARM64 packaging process."
echo "$tmp_linux_arm_pkg created for Linux ARM packaging process."
# Get common build parameters
kernel=`uname -s`
@ -73,9 +67,9 @@ kernel=`uname -s`
buildtime=`date +%Y-%m-%dT%T%z`
# Prepare common linker flags
STRIP_SYMBOLS="-s"
STRIP_SYMBOLS="-w -s"
LINKER_PKG_PATH=github.com/rqlite/rqlite/cmd
LDFLAGS="-$STRIP_SYMBOLS -X $LINKER_PKG_PATH.Version=$VERSION -X $LINKER_PKG_PATH.Branch=$branch -X $LINKER_PKG_PATH.Commit=$commit -X $LINKER_PKG_PATH.Buildtime=$buildtime"
LDFLAGS="$STRIP_SYMBOLS -X $LINKER_PKG_PATH.Version=$VERSION -X $LINKER_PKG_PATH.Branch=$branch -X $LINKER_PKG_PATH.Commit=$commit -X $LINKER_PKG_PATH.Buildtime=$buildtime"
# Prepare the source code
mkdir -p $tmp_build/src/github.com/rqlite
@ -117,37 +111,49 @@ if [ "$kernel" != "Linux" ]; then
exit 0
fi
################################################################################
# Package all other releases
declare -A versions
versions=(
declare -A archs
archs=(
["amd64"]="musl-gcc"
["arm64"]="aarch64-linux-gnu-gcc"
["arm"]="arm-linux-gnueabi-gcc"
["riscv64"]="riscv64-linux-gnu-gcc"
["mips"]="mips-linux-gnu-gcc"
["mipsel"]="mipsel-linux-gnu-gcc"
["mipsle"]="mipsel-linux-gnu-gcc"
["mips64"]="mips64-linux-gnuabi64-gcc"
["mips64le"]="mips64el-linux-gnuabi64-gcc"
["mipsle"]="mipsel-linux-gnu-gcc"
["ppc64"]="powerpc64-linux-gnu-gcc"
["ppc64le"]="powerpc64le-linux-gnu-gcc"
)
for version in "${!versions[@]}"; do
compiler=${versions[$version]}
for arch in "${!archs[@]}"; do
compiler=${archs[$arch]}
rm -f $GOPATH/bin/*
cd $tmp_build/src/github.com/rqlite/rqlite
CGO_ENABLED=1 GOARCH=$version CC=$compiler go install -a -tags sqlite_omit_load_extension -ldflags="$LDFLAGS" ./...
CGO_ENABLED=1 GOARCH=$arch CC=$compiler go install -a -tags sqlite_omit_load_extension -ldflags="$LDFLAGS" ./...
if [ "$compiler" == "musl-gcc" ]; then
release=`echo rqlite-$VERSION-$kernel-$arch-musl | tr '[:upper:]' '[:lower:]'`
else
release=`echo rqlite-$VERSION-$kernel-$arch | tr '[:upper:]' '[:lower:]'`
fi
release=`echo rqlite-$VERSION-$kernel-$version | tr '[:upper:]' '[:lower:]'`
tarball=${release}.tar.gz
mkdir $tmp_linux_${version}_pkg/$release
copy_binaries $tmp_linux_${version}_pkg/$release $GOPATH/bin/linux_$version
( cd $tmp_linux_${version}_pkg; tar cvfz $tarball $release )
tmp_pkg=`mktemp -d`
mkdir -p $tmp_pkg/$release
ls $GOPATH/bin
if [ "$arch" == "amd64" ]; then
copy_binaries $tmp_pkg/$release $GOPATH/bin
else
copy_binaries $tmp_pkg/$release $GOPATH/bin/linux_$arch
fi
( cd $tmp_pkg; tar cvfz $tarball $release )
if [ -n "$API_TOKEN" ]; then
upload_asset $tmp_linux_${version}_pkg/$tarball $RELEASE_ID $API_TOKEN
upload_asset $tmp_pkg/$tarball $RELEASE_ID $API_TOKEN
fi
done

@ -8,7 +8,7 @@ import os
release_template = """
_rqlite_ is a lightweight, distributed relational database, which uses [SQLite](https://www.sqlite.org/) as its storage engine. rqlite provides an easy-to-use, fault-tolerant store for your most important relational data. You can learn a lot more about rqlite at [rqlite.io](https://www.rqlite.io).
Release {release} {release_specific_notes}. See the [CHANGELOG](https://github.com/rqlite/rqlite/blob/master/CHANGELOG.md) for full details on this release.
Release {release} {release_specific_notes}. See the [CHANGELOG](https://github.com/rqlite/rqlite/blob/master/CHANGELOG.md) for full details on this release, and check out the _Assets_ section below for prebuilt binaries.
## Getting started
@ -26,9 +26,9 @@ docker run -p4001:4001 rqlite/rqlite
Check out the [rqlite Docker page](https://hub.docker.com/r/rqlite/rqlite/) for more details on running nodes via Docker.
### Linux
_Builds for AMD and ARM are available. See the Assets section below._
_Builds for a variety of CPU architectures are available. See the Assets section below._
To download and start rqlite, execute the following in a shell.
To download and start rqlite, execute the following in a shell.
```
curl -L https://github.com/rqlite/rqlite/releases/download/{release}/rqlite-{release}-linux-amd64.tar.gz -o rqlite-{release}-linux-amd64.tar.gz

Loading…
Cancel
Save