-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_naprrql.sh
executable file
·145 lines (127 loc) · 2.5 KB
/
build_naprrql.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
set -e
CWD=`pwd`
# code is required for build, but no longer built as separate server
# is launched from within the naprr application
# echo "Downloading nats-streaming-server"
# go get github.com/nats-io/nats-streaming-server
do_build() {
mkdir -p $OUTPUT
cd $CWD
cd ./app/naprrql
go get
GOOS="$GOOS" GOARCH="$GOARCH" go build -ldflags="$LDFLAGS" -o $OUTPUT/$HARNESS
cd ..
rsync -a naprrql/naplan_schema.graphql naprrql/public naprrql/in $OUTPUT/
}
# do_shells() {
# cd $CWD
# cp bin/gonias.sh $OUTPUT/
# cp bin/stopnias.sh $OUTPUT/
# }
# do_bats() {
# cd $CWD
# cp bin/gonias.bat $OUTPUT/
# cp bin/stopnias.bat $OUTPUT/
# }
# do_upx() {
# upx $OUTPUT/$GNATS
# upx $OUTPUT/$HARNESS
# }
# do_goupx() {
# goupx $OUTPUT/$GNATS
# goupx $OUTPUT/$HARNESS
# }
do_zip() {
cd $OUTPUT
cd ..
zip -qr ../$ZIP naprrql
cd $CWD
}
build_mac64() {
# MAC OS X (64 only)
echo "Building Mac binaries..."
GOOS=darwin
GOARCH=amd64
LDFLAGS="-s -w"
OUTPUT=$CWD/build/Mac/naprrql
# GNATS=nats-streaming-server
HARNESS=naprrql
ZIP=naprrql-Mac.zip
do_build
#do_upx
# do_shells
do_zip
echo "...all Mac binaries built..."
}
build_windows64() {
# WINDOWS 64
echo "Building Windows64 binaries..."
GOOS=windows
GOARCH=amd64
LDFLAGS="-s -w"
OUTPUT=$CWD/build/Win64/naprrql
# GNATS=nats-streaming-server.exe
HARNESS=naprrql.exe
ZIP=naprrql-Win64.zip
do_build
#do_upx
# do_bats
do_zip
echo "...all Windows64 binaries built..."
}
build_windows32() {
# WINDOWS 32
echo "Building Windows32 binaries..."
GOOS=windows
GOARCH=386
LDFLAGS="-s -w"
OUTPUT=$CWD/build/Win32/naprrql
# GNATS=nats-streaming-server.exe
HARNESS=naprrql.exe
ZIP=naprrql-Win32.zip
do_build
#do_upx
# do_bats
do_zip
echo "...all Windows32 binaries built..."
}
build_linux64() {
# LINUX 64
echo "Building Linux64 binaries..."
GOOS=linux
GOARCH=amd64
LDFLAGS="-s -w"
OUTPUT=$CWD/build/Linux64/naprrql
# GNATS=nats-streaming-server
HARNESS=naprrql
ZIP=naprrql-Linux64.zip
do_build
#do_goupx
# do_shells
do_zip
echo "...all Linux64 binaries built..."
}
build_linux32() {
# LINUX 32
echo "Building Linux32 binaries..."
GOOS=linux
GOARCH=386
LDFLAGS="-s -w"
OUTPUT=$CWD/build/Linux32/naprrql
# GNATS=nats-streaming-server
HARNESS=naprrql
ZIP=naprrql-Linux32.zip
do_build
#do_goupx
# do_shells
do_zip
echo "...all Linux32 binaries built..."
}
# TODO ARM
# GOOS=linux GOARCH=arm GOARM=7 go build -o $CWD/build/LinuxArm7/go-nias/aggregator
build_mac64
build_windows64
#build_windows32
#build_linux64
#build_linux32