forked from marcapo/goiban-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·37 lines (31 loc) · 762 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·37 lines (31 loc) · 762 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
27
28
29
30
31
32
33
34
35
36
37
#/usr/bin/env bash
CONFIGURATIONS=(
darwin,386 \
darwin,arm64 \
windows,386 \
windows,amd64 \
linux,386 \
linux,amd64 \
linux,arm \
linux,arm64 \
solaris,amd64
)
version=`cat VERSION`
for config in ${CONFIGURATIONS[@]}; do
IFS=","
set $config
os="$1"
arch="$2"
base_path="build/$os/$arch"
path="$base_path/goiban-service"
mkdir -p "$path"
bin_name="goiban-service"
if [ $os = "windows" ]; then
bin_name="$bin_name.exe"
fi
GOOS="$os" GOARCH="$arch" go build -ldflags "-X main.Version=${version}" -o "$path/$bin_name"
cp -r $GOPATH/src/github.com/fourcube/goiban-data-loader/data "$path/"
cp -r ./static "$path/"
tar czvf "build/goiban-service-$version-$os-$arch.tar.gz" -C "$base_path" goiban-service
unset IFS;
done