forked from oracle/oci-grafana-logs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·65 lines (51 loc) · 1.42 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
#Do grunt work
if [[ ! -d ./node_modules ]]; then
echo "dependencies not installed try running: npm install"
exit 1
fi
rm -rf ./oci-logs-datasource
./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
# go mod vendor
# if [[ ! -d ./vendor ]]; then
# echo "dependencies not installed try running | go mod vendor didn't work as expected"
# exit 1
# fi
echo "building go binary"
# For debugger
# GOOS=$GOOS go build -o ./dist/oci-logs-plugin$POST -gcflags="all=-N -l"
# For release
GOOS=$GOOS go build -o ./dist/oci-logs-plugin$POST
GOOS=linux go build -o ./dist/oci-logs-plugin_linux_amd64
GOOS=windows GOARCH=amd64 go build -o ./dist/oci-logs-plugin_windows_amd64.exe
grafana-toolkit plugin:sign
mv ./dist ./oci-logs-datasource
tar cvf plugin.tar ./oci-logs-datasource
zip -r oci-logs-datasource ./oci-logs-datasource
# Instructions for signing
# Please make sure
# nvm install 12.20
# nvm use 12.20
# yarn
# For grafana publishing
# yarn install
# Please make sure if you have the api keys installed in bash profile in name, GRAFANA_API_KEY
# Note : Please make sure that you are running the commands in a non-proxy env and without vpn, else grafana signing might fail"
# yarn global add @grafana/toolkit
# grafana-toolkit plugin:sign