Skip to content
Permalink
Browse files

add go mod support (#586)

  • Loading branch information...
1138-4EB committed Dec 25, 2018
1 parent 59f2863 commit 4945635bd64aa427099d765aac2489e94ee04fcf
Showing with 218 additions and 16 deletions.
  1. +1 βˆ’2 .travis.yml
  2. +1 βˆ’1 build/build.sh
  3. +6 βˆ’9 build/build_all.sh
  4. +6 βˆ’3 build/run_gometalinter.sh
  5. +1 βˆ’1 frontend
  6. +36 βˆ’0 go.mod
  7. +167 βˆ’0 go.sum
@@ -10,7 +10,6 @@ addons:
env:
global:
- USE_DOCKER="true"
- WDIR=/go/src/github.com/filebrowser/filebrowser
stages:
- lint
- test
@@ -34,7 +33,7 @@ jobs:
branch: master
- stage: release
script:
- docker run --rm -itv $(pwd):$WDIR -v /var/run/docker.sock:/var/run/docker.sock filebrowser/dev goreleaser
- docker run --rm -itv $(pwd):/go/src/github.com/filebrowser/filebrowser -v /var/run/docker.sock:/var/run/docker.sock filebrowser/dev goreleaser
- ./build/push_images.sh
- ./build/push_ricebox.sh
if: tag IS present
@@ -12,7 +12,7 @@ if [ "$COMMIT_SHA" != "" ]; then
fi

echo "Build CLI"
CGO_ENABLED=0 go build -a -o filebrowser
go build -a -o filebrowser

if [ "$COMMIT_SHA" != "" ]; then
echo "Reset version to (untracked)"
@@ -11,10 +11,6 @@ if [ "$USE_DOCKER" != "" ]; then
rm -rf frontend/dist
fi;

if [ "$WDIR" = "" ]; then
WDIR="/go/src/github.com/filebrowser/filebrowser"
fi;

if [ "$(command -v git)" != "" ]; then
COMMIT_SHA="$(git rev-parse HEAD | cut -c1-8)"
else
@@ -24,11 +20,10 @@ if [ "$USE_DOCKER" != "" ]; then
$(command -v winpty) docker run -it \
--name filebrowser-tmp \
-v /$(pwd):/src:z \
-w /${WDIR} \
-w //src \
-e COMMIT_SHA=$COMMIT_SHA \
filebrowser/dev \
sh -c "\
cp -r //src/* /$WDIR && \
cd build && \
dos2unix build_assets.sh && \
dos2unix build.sh && \
@@ -39,10 +34,12 @@ if [ "$USE_DOCKER" != "" ]; then

if [ $exitcode -eq 0 ]; then
for d in "dist/" "node_modules/"; do
docker cp filebrowser-tmp:/$WDIR/frontend/$d frontend
docker cp filebrowser-tmp://src/frontend/$d frontend
done
docker cp filebrowser-tmp:/$WDIR/cli/filebrowser ./filebrowser
docker cp filebrowser-tmp:/$WDIR/lib/rice-box.go ./lib/rice-box.go
docker cp filebrowser-tmp://src/cli/filebrowser ./filebrowser
docker cp filebrowser-tmp://src/lib/rice-box.go ./lib/rice-box.go
else
echo "BUILD FAILED!"
fi
docker rm -f filebrowser-tmp
else
@@ -6,10 +6,13 @@ cd $(dirname $0)/..

dolint='gometalinter --exclude="rice-box.go" --exclude="vendor" --deadline=300s ./...'

WDIR="/go/src/github.com/filebrowser/filebrowser"

if [ "$USE_DOCKER" != "" ]; then
docker run --rm -itv $(pwd):/src filebrowser/dev sh -c "\
cp -r /src/. ./ && cd cli && go get -v ./... && \
CGO_ENABLED=0 $dolint"
$(command -v winpty) docker run --rm -itv "/$(pwd):/$WDIR" -w "/$WDIR" filebrowser/dev sh -c "\
GO111MODULE=on go get -v ./... && \
GO111MODULE=on go mod vendor && \
GO111MODULE=off $dolint"
else
$dolint
fi
36 go.mod
@@ -0,0 +1,36 @@
module github.com/filebrowser/filebrowser

require (
github.com/GeertJohan/go.rice v0.0.0-20170420135705-c02ca9a983da
github.com/Sereal/Sereal v0.0.0-20181211220259-509a78ddbda3 // indirect
github.com/asdine/storm v2.1.2+incompatible
github.com/boltdb/bolt v1.3.1 // indirect
github.com/daaku/go.zipexe v0.0.0-20150329023125-a5fe2436ffcb // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76 // indirect
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/gohugoio/hugo v0.49.2
github.com/golang/protobuf v1.2.0 // indirect
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
github.com/google/uuid v1.1.0 // indirect
github.com/gorilla/websocket v1.4.0
github.com/hacdias/fileutils v0.0.0-20181202104838-227b317161a1
github.com/hacdias/varutils v0.0.0-20171121224303-82d3b57f667a
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 // indirect
github.com/maruel/natural v0.0.0-20180416170133-dbcb3e2e8cf1
github.com/mholt/archiver v2.1.0+incompatible
github.com/mholt/caddy v0.11.1
github.com/mitchellh/go-homedir v1.0.0
github.com/mitchellh/mapstructure v1.1.2
github.com/nwaples/rardecode v1.0.0 // indirect
github.com/pierrec/lz4 v2.0.5+incompatible // indirect
github.com/robfig/cron v0.0.0-20180505203441-b41be1df6967
github.com/spf13/cobra v0.0.3
github.com/spf13/viper v1.3.1
github.com/ulikunitz/xz v0.5.5 // indirect
github.com/vmihailenco/msgpack v4.0.1+incompatible // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
go.etcd.io/bbolt v1.3.0 // indirect
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9
gopkg.in/natefinch/lumberjack.v2 v2.0.0
)

0 comments on commit 4945635

Please sign in to comment.
You can’t perform that action at this time.