forked from oracle/oci-grafana-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·46 lines (35 loc) · 808 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
37
38
39
40
41
42
43
44
45
#!/bin/bash
#Do grunt work
if [[ ! -d ./node_modules ]]; then
echo "dependencies not installed try running: npm install"
exit 1
fi
./node_modules/.bin/grunt
# build go
POST=''
GOOS=''
OS="`uname`"
case $OS in
'Linux')
POST='_linux_amd64'
GOOS="linux"
;;
'Darwin')
POST='_darwin_amd64'
GOOS="darwin"
;;
'AIX') ;;
*) ;;
esac
if [[ ! -d ./vendor ]]; then
echo "dependencies not installed try running: dep ensure"
exit 1
fi
echo "building go binary"
GOOS=$GOOS go build -o ./dist/oci-plugin$POST
# For debugger
# GOOS=$GOOS go build -o ./dist/oci-plugin$POST -gcflags="all=-N -l"
# For release
# GOOS=linux go build -o ./dist/oci-plugin_linux_amd64
# GOOS=windows GOARCH=amd64 go build -o ./dist/oci-plugin_windows_amd64.exe
# tar cvf plugin.tar ./dist