forked from coreos/fleet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild
More file actions
executable file
·26 lines (20 loc) · 733 Bytes
/
build
File metadata and controls
executable file
·26 lines (20 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash -e
ORG_PATH="github.com/coreos"
REPO_PATH="${ORG_PATH}/fleet"
VERSION=$(git describe --dirty)
GLDFLAGS="-X github.com/coreos/fleet/version.Version \"${VERSION}\""
if [ ! -h gopath/src/${REPO_PATH} ]; then
mkdir -p gopath/src/${ORG_PATH}
ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
fi
export GOBIN=${PWD}/bin
export GOPATH=${PWD}/gopath
eval $(go env)
if [ ${GOOS} = "linux" ]; then
echo "Building fleetd..."
CGO_ENABLED=0 go build -o bin/fleetd -a -installsuffix netgo -ldflags "${GLDFLAGS}" ${REPO_PATH}/fleetd
else
echo "Not on Linux - skipping fleetd build"
fi
echo "Building fleetctl..."
CGO_ENABLED=0 go build -o bin/fleetctl -a -installsuffix netgo -ldflags "${GLDFLAGS}" ${REPO_PATH}/fleetctl