-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Runfile
35 lines (31 loc) · 1.25 KB
/
Runfile
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
27
28
29
30
31
32
33
34
35
EXPORT RUN := ${.RUN}
EXPORT RUNFILE := ${.RUNFILE}
##
# Build Covey
# OPTION LIVE -l, --live Build Covey without bundling any assets.
# OPTION RELEASE -r, --release Strip symbols and compress Covey binary.
build:
TAGS=""
LD=""
"${RUN}" -r "${RUNFILE}" agent --release
[[ "${LIVE}" ]] && TAGS=-tags=live && echo "Building Covey without assets"
[[ "${RELEASE}" ]] && echo "Building Covey without symbols"
echo "Building Covey"
[[ "${RELEASE}" ]] \
&& go build -trimpath ${TAGS} -ldflags="-s -w" github.com/chabad360/covey \
|| go build -trimpath ${TAGS} github.com/chabad360/covey
[[ "${RELEASE}" ]] && echo "Compressing binary" && upx covey
##
# Build Covey Agent
# OPTION RELEASE -r, --release Strip symbols and compress the Agent binary.
agent:
LD=""
echo "Building Covey Agent"
[[ "${RELEASE}" ]] \
&& echo "Building Covey Agent without symbols" \
&& go build -trimpath -ldflags="-s -w" -o assets/agent/agent github.com/chabad360/covey/agent \
|| go build -o assets/agent/agent github.com/chabad360/covey/agent
[[ "${RELEASE}" ]] && echo "Compressing binary" && upx assets/agent/agent
## Build and run Covey with -tag live
run:
"${RUN}" -r "${RUNFILE}" build --live && ./covey