Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
fourcube committed May 15, 2018
1 parent c8165f5 commit 04ebde2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
test/*.html
*.vr
goiban-service
build/
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.PHONY: dev
.PHONY: dev build

dev:
go build
./goiban-service 8080 root:root@/goiban?charset=utf8
./goiban-service 8080 root:root@/goiban?charset=utf8

build:
./build.sh
33 changes: 33 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#/usr/bin/env bash
CONFIGURATIONS=(
darwin,386 \
windows,386 \
windows,amd64 \
linux,386 \
linux,amd64 \
linux,arm \
linux,arm64 \
solaris,amd64
)

for config in ${CONFIGURATIONS[@]}; do
IFS=","
set $config

os="$1"
arch="$2"
path="build/$os/$arch"
mkdir -p "build/$os/$arch"
bin_name="goiban-service"

if [ $os = "windows" ]; then
bin_name="$bin_name.exe"
fi

GOOS="$os" GOARCH="$arch" go build -o "$path/$bin_name"
cp -r $GOPATH/src/github.com/fourcube/goiban-data-loader/data "$path/"
cp -r ./static "$path/"
tar -czf "build/goiban-service-$os-$arch.tar.gz" "$path"

unset IFS;
done

0 comments on commit 04ebde2

Please sign in to comment.