-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·65 lines (49 loc) · 1.24 KB
/
build.sh
File metadata and controls
executable file
·65 lines (49 loc) · 1.24 KB
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
export GOSUMDB=off
#--- set module mode
export GO111MODULE=on
export WORKING_DIR=${PWD}
echo "~~~> Compile/Minify UI"
pushd ${PWD}/go/frontend
export NODE_OPTIONS="--max_old_space_size=4096"
npm ci -s --no-optional --force
npm run -s production-build
if [ $? -eq 0 ]
then
echo "~~~> production-build succeeded"
else
echo "~~~> production-build failed " >&2
exit 1
fi
bindDataFile=resources/web-site.go
if [ -f "$bindDataFile" ]; then
echo "~~~> web-site.go found, removing"
rm $bindDataFile
fi
echo "~~~> Binding in web assets"
mkdir -p resources
go-bindata -o resources/web-site.go -pkg resources build/...
popd
pushd ${PWD}/go
go generate
if [ $? -eq 0 ]
then
echo "~~~> go generate succeeded"
else
echo "~~~> go generate failed " >&2
exit 1
fi
echo "~~~> Updating dependencies"
go mod tidy
if [ $? -eq 0 ]
then
echo "~~~> go mod tidy succeeded"
else
echo "~~~> go mod tidy failed " >&2
exit 1
fi
export GOSUMDB=off
export G0111MODULE=onS
export OUTPUT_DIR="exe"
export LD_FLAGS="-X \"main.Version=$VERSION\""
env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -ldflags "${LD_FLAGS}" -o ${OUTPUT_DIR}/csa csa.go
popd