nd002test/on-premise/main/rancher_v2.9.1/source/rancher-2.9.1/scripts/build-agent

22 lines
405 B
Bash
Executable File

#!/bin/bash
set -e
source $(dirname $0)/version
cd $(dirname $0)/..
mkdir -p bin
if [ -n "${DEBUG}" ]; then
GCFLAGS="-N -l"
fi
if [ "$(uname)" != "Darwin" ]; then
LINKFLAGS="-extldflags -static"
if [ -z "${DEBUG}" ]; then
LINKFLAGS="${LINKFLAGS} -s"
fi
fi
CGO_ENABLED=0 go build -tags k8s -gcflags="all=${GCFLAGS}" -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/agent ./cmd/agent