-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·35 lines (26 loc) · 824 Bytes
/
build.sh
File metadata and controls
executable file
·35 lines (26 loc) · 824 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
#! /bin/bash
VERSION=v0.1.$(git rev-parse --short HEAD)
echo $VERSION
[ -d /usr/local/go1.7 ] && {
export GOROOT=/usr/local/go1.7/
export PATH=/usr/local/go1.7/bin/:$PATH
}
export GOPATH=$(pwd)/gopath/
go version
ROOT=./
mkdir -p gopath/src/elastic-trib/
rsync -arvz ${ROOT}/Makefile ${ROOT}/elastic-trib.yaml ${ROOT}/*.go gopath/src/elastic-trib
rsync -arvz ${ROOT}/vendor/ gopath/src/elastic-trib
rsync -arvz ${ROOT}/vendor/ gopath/src/
output=${PWD}/output
echo "Building elastic-trib"
cd gopath/src/elastic-trib
go build -i -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION}" -o ${output}/elastic-trib .
if [ "$?" != "0" ]; then
echo "build elastic-trib failed"
cd - && rm -rf ./gopath
exit 1
fi
cp -rf elastic-trib.yaml ${output}/
cd - && rm -rf ./gopath
echo "end building"