From a184b775b35c5bfde79cbe666949e56093955e0e Mon Sep 17 00:00:00 2001 From: Equim Date: Sun, 25 Feb 2018 16:55:48 +0800 Subject: [PATCH] chore: use dep to manage vendor (#364) --- .circleci/config.yml | 17 +- .gitignore | 3 +- Dockerfile | 49 ++--- Gopkg.lock | 423 +++++++++++++++++++++++++++++++++++++++++++ Gopkg.toml | 70 +++++++ 5 files changed, 530 insertions(+), 32 deletions(-) create mode 100644 Gopkg.lock create mode 100644 Gopkg.toml diff --git a/.circleci/config.yml b/.circleci/config.yml index 8a5562b1..8c144171 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,9 @@ jobs: - run: name: Install Dependencies command: | - cd cmd/filebrowser && go get ./... && cd ../.. + curl -sL -o $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 + chmod +x $GOPATH/bin/dep + dep ensure -v go get github.com/alecthomas/gometalinter gometalinter --install - run: @@ -32,11 +34,12 @@ jobs: - run: name: Install Dependencies command: | - cd cmd/filebrowser - go get ./... + curl -sL -o $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 + chmod +x $GOPATH/bin/dep + dep ensure -v - run: name: Building - command: go build + command: go build github.com/filebrowser/filebrowser/cmd/filebrowser deploy: docker: - image: circleci/golang:1.10 @@ -46,9 +49,9 @@ jobs: - run: name: Install Dependencies command: | - cd cmd/filebrowser - go get ./... - cd ../.. + curl -sL -o $GOPATH/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 + chmod +x $GOPATH/bin/dep + dep ensure -v - run: name: Deploy command: curl -sL https://git.io/goreleaser | bash diff --git a/.gitignore b/.gitignore index c4bbc189..98b81469 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ yarn-error.log* .idea .vscode package-lock.json -yarn.lock \ No newline at end of file +yarn.lock +vendor diff --git a/Dockerfile b/Dockerfile index e238dbaf..91a8bd82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,25 @@ - -FROM golang:alpine - -COPY . /go/src/github.com/filebrowser/filebrowser - -WORKDIR /go/src/github.com/filebrowser/filebrowser -RUN apk add --no-cache git -RUN go get ./... - -WORKDIR /go/src/github.com/filebrowser/filebrowser/cmd/filebrowser -RUN CGO_ENABLED=0 go build -a -RUN mv filebrowser /go/bin/filebrowser - -FROM scratch -COPY --from=0 /go/bin/filebrowser /filebrowser - -VOLUME /tmp -VOLUME /srv -EXPOSE 80 - -COPY Docker.json /config.json - -ENTRYPOINT ["/filebrowser"] -CMD ["--config", "/config.json"] +FROM golang:alpine + +COPY . /go/src/github.com/filebrowser/filebrowser + +WORKDIR /go/src/github.com/filebrowser/filebrowser +RUN apk add --no-cache git curl && \ + curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 && \ + chmod +x /usr/local/bin/dep +RUN dep ensure -vendor-only + +WORKDIR /go/src/github.com/filebrowser/filebrowser/cmd/filebrowser +RUN CGO_ENABLED=0 go build -a +RUN mv filebrowser /go/bin/filebrowser + +FROM scratch +COPY --from=0 /go/bin/filebrowser /filebrowser + +VOLUME /tmp +VOLUME /srv +EXPOSE 80 + +COPY Docker.json /config.json + +ENTRYPOINT ["/filebrowser"] +CMD ["--config", "/config.json"] diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 00000000..e69f5fcb --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,423 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + branch = "master" + name = "github.com/BurntSushi/toml" + packages = ["."] + revision = "a368813c5e648fee92e5f6c30e3944ff9d5e8895" + +[[projects]] + branch = "master" + name = "github.com/GeertJohan/go.rice" + packages = [ + ".", + "embedded" + ] + revision = "c02ca9a983da5807ddf7d796784928f5be4afd09" + +[[projects]] + branch = "master" + name = "github.com/aead/chacha20" + packages = [ + ".", + "chacha" + ] + revision = "c8d29375923a8e1d2a0f0dc0fc1d8a0aba5b97ba" + +[[projects]] + name = "github.com/asdine/storm" + packages = [ + ".", + "codec", + "codec/json", + "index", + "internal", + "q" + ] + revision = "68fc73b635f890fe7ba2f3b15ce80c85b28a744f" + version = "v2.0.2" + +[[projects]] + branch = "master" + name = "github.com/bifurcation/mint" + packages = [ + ".", + "syntax" + ] + revision = "340be3ae8c0ff8edce24cf59e7acdb1432bd5ce5" + +[[projects]] + name = "github.com/chaseadamsio/goorgeous" + packages = ["."] + revision = "dcf1ef873b8987bf12596fe6951c48347986eb2f" + version = "v1.1.0" + +[[projects]] + branch = "master" + name = "github.com/codahale/aesnicheck" + packages = ["."] + revision = "349fcc471aaccc29cd074e1275f1a494323826cd" + +[[projects]] + name = "github.com/coreos/bbolt" + packages = ["."] + revision = "583e8937c61f1af6513608ccc75c97b6abdf4ff9" + version = "v1.3.0" + +[[projects]] + branch = "master" + name = "github.com/daaku/go.zipexe" + packages = ["."] + revision = "a5fe2436ffcb3236e175e5149162b41cd28bd27d" + +[[projects]] + name = "github.com/dgrijalva/jwt-go" + packages = [ + ".", + "request" + ] + revision = "dbeaa9332f19a944acb5736b4456cfcc02140e29" + version = "v3.1.0" + +[[projects]] + branch = "master" + name = "github.com/dsnet/compress" + packages = [ + ".", + "bzip2", + "bzip2/internal/sais", + "internal", + "internal/errors", + "internal/prefix" + ] + revision = "cc9eb1d7ad760af14e8f918698f745e80377af4f" + +[[projects]] + branch = "master" + name = "github.com/flynn/go-shlex" + packages = ["."] + revision = "3f9db97f856818214da2e1057f8ad84803971cff" + +[[projects]] + name = "github.com/fsnotify/fsnotify" + packages = ["."] + revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" + version = "v1.4.7" + +[[projects]] + name = "github.com/gohugoio/hugo" + packages = ["parser"] + revision = "25e88ccabe9b04c42ffb43528c86743f623fac46" + version = "v0.36.1" + +[[projects]] + branch = "master" + name = "github.com/golang/snappy" + packages = ["."] + revision = "553a641470496b2327abcac10b36396bd98e45c9" + +[[projects]] + name = "github.com/gorilla/websocket" + packages = ["."] + revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b" + version = "v1.2.0" + +[[projects]] + branch = "master" + name = "github.com/hacdias/fileutils" + packages = ["."] + revision = "76b1c6ab906773727a1ce2f7fb22830685166f85" + +[[projects]] + branch = "master" + name = "github.com/hacdias/varutils" + packages = ["."] + revision = "82d3b57f667a756cfc4b1535951b46878881f3e1" + +[[projects]] + branch = "master" + name = "github.com/hashicorp/go-syslog" + packages = ["."] + revision = "326bf4a7f709d263f964a6a96558676b103f3534" + +[[projects]] + branch = "master" + name = "github.com/hashicorp/golang-lru" + packages = [ + ".", + "simplelru" + ] + revision = "0fb14efe8c47ae851c0034ed7a448854d3d34cf3" + +[[projects]] + branch = "master" + name = "github.com/hashicorp/hcl" + packages = [ + ".", + "hcl/ast", + "hcl/parser", + "hcl/scanner", + "hcl/strconv", + "hcl/token", + "json/parser", + "json/scanner", + "json/token" + ] + revision = "23c074d0eceb2b8a5bfdbb271ab780cde70f05a8" + +[[projects]] + branch = "master" + name = "github.com/kardianos/osext" + packages = ["."] + revision = "ae77be60afb1dcacde03767a8c37337fad28ac14" + +[[projects]] + branch = "master" + name = "github.com/lucas-clemente/aes12" + packages = ["."] + revision = "cd47fb39b79f867c6e4e5cd39cf7abd799f71670" + +[[projects]] + branch = "master" + name = "github.com/lucas-clemente/fnv128a" + packages = ["."] + revision = "393af48d391698c6ae4219566bfbdfef67269997" + +[[projects]] + name = "github.com/lucas-clemente/quic-go" + packages = [ + ".", + "h2quic", + "internal/ackhandler", + "internal/congestion", + "internal/crypto", + "internal/flowcontrol", + "internal/handshake", + "internal/protocol", + "internal/utils", + "internal/wire", + "qerr" + ] + revision = "30851b9a3b4e958490b476fe72adafa67641361a" + version = "v0.7.0" + +[[projects]] + branch = "master" + name = "github.com/lucas-clemente/quic-go-certificates" + packages = ["."] + revision = "d2f86524cced5186554df90d92529757d22c1cb6" + +[[projects]] + name = "github.com/magiconair/properties" + packages = ["."] + revision = "c3beff4c2358b44d0493c7dda585e7db7ff28ae6" + version = "v1.7.6" + +[[projects]] + name = "github.com/mholt/archiver" + packages = ["."] + revision = "26cf5bb32d07aa4e8d0de15f56ce516f4641d7df" + +[[projects]] + name = "github.com/mholt/caddy" + packages = [ + ".", + "caddyfile", + "caddyhttp/httpserver", + "caddyhttp/staticfiles", + "caddytls" + ] + revision = "d3f338ddab9ee24b376b5c9c51e202581e2d43ba" + version = "v0.10.11" + +[[projects]] + name = "github.com/miekg/dns" + packages = ["."] + revision = "5364553f1ee9cddc7ac8b62dce148309c386695b" + version = "v1.0.4" + +[[projects]] + branch = "master" + name = "github.com/mitchellh/mapstructure" + packages = ["."] + revision = "00c29f56e2386353d58c599509e8dc3801b0d716" + +[[projects]] + branch = "master" + name = "github.com/nwaples/rardecode" + packages = ["."] + revision = "e06696f847aeda6f39a8f0b7cdff193b7690aef6" + +[[projects]] + name = "github.com/pelletier/go-toml" + packages = ["."] + revision = "acdc4509485b587f5e675510c4f2c63e90ff68a8" + version = "v1.1.0" + +[[projects]] + name = "github.com/pierrec/lz4" + packages = ["."] + revision = "2fcda4cb7018ce05a25959d2fe08c83e3329f169" + version = "v1.1" + +[[projects]] + name = "github.com/pierrec/xxHash" + packages = ["xxHash32"] + revision = "f051bb7f1d1aaf1b5a665d74fb6b0217712c69f7" + version = "v0.1.1" + +[[projects]] + name = "github.com/robfig/cron" + packages = ["."] + revision = "b024fc5ea0e34bc3f83d9941c8d60b0622bfaca4" + version = "v1" + +[[projects]] + name = "github.com/russross/blackfriday" + packages = ["."] + revision = "4048872b16cc0fc2c5fd9eacf0ed2c2fedaa0c8c" + version = "v1.5" + +[[projects]] + branch = "master" + name = "github.com/shurcooL/sanitized_anchor_name" + packages = ["."] + revision = "86672fcb3f950f35f2e675df2240550f2a50762f" + +[[projects]] + name = "github.com/spf13/afero" + packages = [ + ".", + "mem" + ] + revision = "bb8f1927f2a9d3ab41c9340aa034f6b803f4359c" + version = "v1.0.2" + +[[projects]] + name = "github.com/spf13/cast" + packages = ["."] + revision = "8965335b8c7107321228e3e3702cab9832751bac" + version = "v1.2.0" + +[[projects]] + branch = "master" + name = "github.com/spf13/jwalterweatherman" + packages = ["."] + revision = "7c0cea34c8ece3fbeb2b27ab9b59511d360fb394" + +[[projects]] + name = "github.com/spf13/pflag" + packages = ["."] + revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66" + version = "v1.0.0" + +[[projects]] + name = "github.com/spf13/viper" + packages = ["."] + revision = "25b30aa063fc18e48662b86996252eabdcf2f0c7" + version = "v1.0.0" + +[[projects]] + name = "github.com/ulikunitz/xz" + packages = [ + ".", + "internal/hash", + "internal/xlog", + "lzma" + ] + revision = "0c6b41e72360850ca4f98dc341fd999726ea007f" + version = "v0.5.4" + +[[projects]] + name = "github.com/xenolf/lego" + packages = ["acme"] + revision = "67c86d860a797ce2483f50d9174d4ed24984bef2" + version = "v0.4.1" + +[[projects]] + branch = "master" + name = "golang.org/x/crypto" + packages = [ + "bcrypt", + "blowfish", + "curve25519", + "ed25519", + "ed25519/internal/edwards25519", + "hkdf", + "ocsp" + ] + revision = "49796115aa4b964c318aad4f3084fdb41e9aa067" + +[[projects]] + branch = "master" + name = "golang.org/x/net" + packages = [ + "bpf", + "http2", + "http2/hpack", + "idna", + "internal/iana", + "internal/socket", + "ipv4", + "ipv6", + "lex/httplex", + "publicsuffix" + ] + revision = "cbe0f9307d0156177f9dd5dc85da1a31abc5f2fb" + +[[projects]] + branch = "master" + name = "golang.org/x/sys" + packages = ["unix"] + revision = "88d2dcc510266da9f7f8c7f34e1940716cab5f5c" + +[[projects]] + name = "golang.org/x/text" + packages = [ + "collate", + "collate/build", + "internal/colltab", + "internal/gen", + "internal/tag", + "internal/triegen", + "internal/ucd", + "language", + "secure/bidirule", + "transform", + "unicode/bidi", + "unicode/cldr", + "unicode/norm", + "unicode/rangetable" + ] + revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" + version = "v0.3.0" + +[[projects]] + name = "gopkg.in/natefinch/lumberjack.v2" + packages = ["."] + revision = "a96e63847dc3c67d17befa69c303767e2f84e54f" + version = "v2.1" + +[[projects]] + name = "gopkg.in/square/go-jose.v1" + packages = [ + ".", + "cipher", + "json" + ] + revision = "aa2e30fdd1fe9dd3394119af66451ae790d50e0d" + version = "v1.1.0" + +[[projects]] + name = "gopkg.in/yaml.v2" + packages = ["."] + revision = "7f97868eec74b32b0982dd158a51a446d1da7eb5" + version = "v2.1.1" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "1f68bed4490068370884abaa296aa651c27b3f2e0d0451a1ab567f059d44f820" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 00000000..22b5603f --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,70 @@ +[[constraint]] + branch = "master" + name = "github.com/GeertJohan/go.rice" + +[[constraint]] + name = "github.com/asdine/storm" + version = "2.0.2" + +[[constraint]] + name = "github.com/dgrijalva/jwt-go" + version = "3.1.0" + +[[constraint]] + name = "github.com/gohugoio/hugo" + version = "0.36.1" + +[[constraint]] + name = "github.com/gorilla/websocket" + version = "1.2.0" + +[[constraint]] + branch = "master" + name = "github.com/hacdias/fileutils" + +[[constraint]] + branch = "master" + name = "github.com/hacdias/varutils" + +[[constraint]] + name = "github.com/mholt/archiver" +# TODO: switch to version when it's available +# this is for Archiver.Write() which was introduced in 548c791 + revision = "26cf5bb32d07aa4e8d0de15f56ce516f4641d7df" +# version = "2.0.0" + +[[constraint]] + name = "github.com/mholt/caddy" + version = "0.10.11" + +[[constraint]] + branch = "master" + name = "github.com/mitchellh/mapstructure" + +[[constraint]] + name = "github.com/robfig/cron" + version = "1.0.0" + +[[constraint]] + name = "github.com/spf13/pflag" + version = "1.0.0" + +[[constraint]] + name = "github.com/spf13/viper" + version = "1.0.0" + +[[constraint]] + branch = "master" + name = "golang.org/x/crypto" + +[[constraint]] + name = "gopkg.in/natefinch/lumberjack.v2" + version = "2.1.0" + +[[override]] + name = "github.com/russross/blackfriday" + version = "^1.0.0" + +[prune] + go-tests = true + unused-packages = true