1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-07 00:46:53 +01:00
Files
glusterd2/scripts/build.sh
2017-02-28 14:02:47 +05:30

24 lines
777 B
Bash
Executable File

#!/usr/bin/env bash
## This scripts builds a GD2 binary and places it in the given path
## Should be called from the root of the GD2 repo as
## ./scripts/build.sh [<path-to-output-directory>]
## If no path is given, defaults to build
OUTDIR=build
if [ "x$1" != "x" ]; then
OUTDIR=$1
fi
VERSION=$($(dirname $0)/pkg-version --full)
LDFLAGS="-X github.com/gluster/glusterd2/gdctx.GlusterdVersion=$VERSION"
BIN=$(basename $(go list -f '{{.ImportPath}}'))
echo "Building $BIN $VERSION"
## Adding GOTAGS so that mgmt builds without the libvirt and augeas resrouces on centos-ci
## TODO Remove this once mgmt can be built engine only without resources
go build -ldflags "${LDFLAGS}" -o $OUTDIR/$BIN -tags "novirt noaugeas" || exit 1
echo "Built $BIN $VERSION at $OUTDIR/$BIN"