-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·36 lines (31 loc) · 950 Bytes
/
build.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
#!/bin/bash
#
# Setup for GOPATH and GOBIN environment variables
# Import all frameworks and packages from github and golang
# build and run the gocouch database
#
# Author - Dragos STOICA
# Date: 23.02.2016
#
# Clean and exit - this must be performed before commit
if [ $# -eq 1 ] && [ "$1" == "clean" ]; then
echo "Cleanup the directories and executable"
rm -fr bin pkg src/github.com src/golang.org gocouch
exit 0
fi
# Else get the depencies and build the executable
export GOPATH=`pwd`
export GOBIN=$GOPATH/bin
# Cleanup the folders and executable
rm -fr bin pkg src/github.com src/golang.org gocouch
# Create necessay structure
mkdir -p bin
mkdir -p pkg
# Keep BoltDB stable final version. There is an alternative proposed on the github page
go get -u github.com/boltdb/bolt/...
go get -u github.com/labstack/echo/...
go get -u golang.org/x/crypto/...
go get -u golang.org/x/net ...
go get -u golang.org/x/text ...
go build
./gocouch