Skip to content
Snippets Groups Projects
build 527 B
Newer Older
Sheng Yang's avatar
Sheng Yang committed
#!/bin/bash
set -e

source $(dirname $0)/version
Sheng Yang's avatar
Sheng Yang committed

cd $(dirname $0)/..

mkdir -p bin
if [ "$(uname)" = "Linux" ]; then
Darren Shepherd's avatar
Darren Shepherd committed
    OTHER_LINKFLAGS="-extldflags -static -s -w"
Darren Shepherd's avatar
Darren Shepherd committed
LINKFLAGS="-X main.VERSION=$VERSION"
CGO_ENABLED=0 go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/local-path-provisioner
if [ "$CROSS" = "true" ] && [ "$ARCH" = "amd64" ]; then
    GOOS=darwin go build -ldflags "$LINKFLAGS" -o bin/local-path-provisioner-darwin
    GOOS=windows go build -ldflags "$LINKFLAGS" -o bin/local-path-provisioner-windows
fi