2018-06-06 20:02:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2018-08-21 21:42:03 +00:00
|
|
|
cd $(dirname $0)/../cli
|
2018-06-06 20:02:00 +00:00
|
|
|
|
2018-08-21 21:42:03 +00:00
|
|
|
go get -v ./...
|
2018-06-06 20:02:00 +00:00
|
|
|
|
2018-08-20 09:41:06 +00:00
|
|
|
if [ "$COMMIT_SHA" != "" ]; then
|
|
|
|
echo "Set version to ($COMMIT_SHA)"
|
2018-08-21 21:42:03 +00:00
|
|
|
sed -i.bak "s|(untracked)|($COMMIT_SHA)|g" ../lib/filebrowser.go
|
2018-08-20 09:41:06 +00:00
|
|
|
fi
|
|
|
|
|
2018-08-22 12:15:55 +00:00
|
|
|
echo "Build CLI"
|
2018-08-21 21:42:03 +00:00
|
|
|
CGO_ENABLED=0 go build -a -o filebrowser
|
2018-08-20 09:41:06 +00:00
|
|
|
|
|
|
|
if [ "$COMMIT_SHA" != "" ]; then
|
|
|
|
echo "Reset version to (untracked)"
|
2018-08-21 21:42:03 +00:00
|
|
|
sed -i "s|($COMMIT_SHA)|(untracked)|g" ../lib/filebrowser.go
|
2018-08-20 09:41:06 +00:00
|
|
|
fi
|