2018-06-06 20:02:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
|
|
|
dep ensure -vendor-only
|
|
|
|
|
2018-08-20 09:41:06 +00:00
|
|
|
if [ "$COMMIT_SHA" != "" ]; then
|
|
|
|
echo "Set version to ($COMMIT_SHA)"
|
|
|
|
sed -i.bak "s|(untracked)|($COMMIT_SHA)|g" filebrowser.go
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Build cmd/filebrowser"
|
2018-06-06 20:02:00 +00:00
|
|
|
cd cmd/filebrowser
|
|
|
|
CGO_ENABLED=0 go build -a
|
|
|
|
cd ../..
|
|
|
|
cp cmd/filebrowser/filebrowser ./
|
2018-08-20 09:41:06 +00:00
|
|
|
|
|
|
|
if [ "$COMMIT_SHA" != "" ]; then
|
|
|
|
echo "Reset version to (untracked)"
|
|
|
|
sed -i "s|($COMMIT_SHA)|(untracked)|g" filebrowser.go
|
|
|
|
fi
|