Permalink
Browse files

Add vendoring for managing dependencies

Govendor is one of the less intrusive dependency manager.
  • Loading branch information...
1 parent 04aef7d commit afa7c848548a0892f539dcb7f8edd1616286f043 @etix committed Mar 3, 2017
Showing with 73 additions and 11 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 CHANGELOG.md
  3. +15 −11 Makefile
  4. +1 −0 README.md
  5. +55 −0 vendor/vendor.json
View
@@ -1,4 +1,5 @@
bin
dist
tmp
+vendor/*/
*~
View
@@ -25,6 +25,7 @@
- Mirrorlist and Mirrorstats UI refresh
- Use UTC time on mirrorlist / mirrorstats page
- Improved error reporting
+- Add dependency vendoring
### BUGFIXES
View
@@ -1,38 +1,42 @@
-.PHONY: all build dev install clean release
+.PHONY: all build dev install clean release vendor
VERSION := $(shell git describe --always --dirty --tags)
SHA := $(shell git rev-parse --short HEAD)
BRANCH := $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))
BUILD := $(SHA)-$(BRANCH)
-PACKAGE := dist/mirrorbits-$(VERSION).tar.gz
+TARBALL := dist/mirrorbits-$(VERSION).tar.gz
-SYMBOLSPREFIX = github.com/etix/mirrorbits/
+PACKAGE = github.com/etix/mirrorbits
-GOFLAGS := -ldflags "-X $(SYMBOLSPREFIX)core.VERSION=$(VERSION) -X $(SYMBOLSPREFIX)core.BUILD=$(BUILD)"
-GOFLAGSDEV := -race -ldflags "-X $(SYMBOLSPREFIX)core.VERSION=$(VERSION) -X $(SYMBOLSPREFIX)core.BUILD=$(BUILD) -X $(SYMBOLSPREFIX)core.DEV=-dev"
+GOFLAGS := -ldflags "-X $(PACKAGE)/core.VERSION=$(VERSION) -X $(PACKAGE)/core.BUILD=$(BUILD)"
+GOFLAGSDEV := -race -ldflags "-X $(PACKAGE)/core.VERSION=$(VERSION) -X $(PACKAGE)/core.BUILD=$(BUILD) -X $(PACKAGE)/core.DEV=-dev"
all: build
-build:
+vendor:
+ go get github.com/kardianos/govendor
+ govendor sync ${PACKAGE}
+
+build: vendor
go build $(GOFLAGS) -o bin/mirrorbits .
-dev:
+dev: vendor
go build $(GOFLAGSDEV) -o bin/mirrorbits .
-install:
+install: vendor
go install -v $(GOFLAGS) .
clean:
@echo Cleaning workspace...
@rm -f bin/mirrorbits
@rm -dRf dist
-release: $(PACKAGE)
+release: $(TARBALL)
test:
- @go test $(GOFLAGS) -v -cover ./...
+ @govendor test $(GOFLAGS) -v -cover +local
-$(PACKAGE): build
+$(TARBALL): build
@echo Packaging release...
@mkdir -p tmp/mirrorbits
@cp -f bin/mirrorbits tmp/mirrorbits/
View
@@ -45,6 +45,7 @@ Yet some things might change before the 1.0 release. If you intend to deploy Mir
## Prerequisites
+* Go 1.6 or later (for vendoring support)
* Redis 2.8.12 (or later)
* libgeoip
* a recent GeoIP version 1 database from [Maxmind](http://www.maxmind.com/app/c) (see [contrib/geoip/](contrib/geoip/))
View
@@ -0,0 +1,55 @@
+{
+ "comment": "",
+ "ignore": "test",
+ "package": [
+ {
+ "checksumSHA1": "eU7l2ETuo7aSjNQLkproRcQqI+M=",
+ "path": "github.com/etix/geoip",
+ "revision": "db8457352061099b2a1840c712b3223900216588",
+ "revisionTime": "2015-08-06T21:40:06Z"
+ },
+ {
+ "checksumSHA1": "Q7mGz8LZRezzZjrmBAL4wNJ6WrQ=",
+ "path": "github.com/etix/goftp",
+ "revision": "0c13163a1028e83f0f1cce113dddd3900e935bc7",
+ "revisionTime": "2017-02-17T14:02:26Z"
+ },
+ {
+ "checksumSHA1": "2UmMbNHc8FBr98mJFN1k8ISOIHk=",
+ "path": "github.com/garyburd/redigo/internal",
+ "revision": "8c052d82153967815d9093a7e9d3e7fd2e554861",
+ "revisionTime": "2017-01-01T00:10:20Z"
+ },
+ {
+ "checksumSHA1": "pofHSvosTrIPzQyddaLX5wy0ehI=",
+ "path": "github.com/garyburd/redigo/redis",
+ "revision": "8c052d82153967815d9093a7e9d3e7fd2e554861",
+ "revisionTime": "2017-01-01T00:10:20Z"
+ },
+ {
+ "checksumSHA1": "BoXdUBWB8UnSlFlbnuTQaPqfCGk=",
+ "path": "github.com/op/go-logging",
+ "revision": "970db520ece77730c7e4724c61121037378659d9",
+ "revisionTime": "2016-03-15T20:05:05Z"
+ },
+ {
+ "checksumSHA1": "Unxe1vo0iwesQlY5NkFCCknuVG0=",
+ "path": "github.com/rafaeljusto/redigomock",
+ "revision": "8a39246926d9f2a732f775c5b360d7078191cbbd",
+ "revisionTime": "2016-11-22T09:20:17Z"
+ },
+ {
+ "checksumSHA1": "hiOUviIMDKo7y918uBiEhfJyOkk=",
+ "path": "gopkg.in/tylerb/graceful.v1",
+ "revision": "50a48b6e73fcc75b45e22c05b79629a67c79e938",
+ "revisionTime": "2016-08-29T01:00:30Z"
+ },
+ {
+ "checksumSHA1": "0KwOlQV1dNUh9X8t+5s7nX5bqfk=",
+ "path": "gopkg.in/yaml.v2",
+ "revision": "a3f3340b5840cee44f372bddb5880fcbc419b46a",
+ "revisionTime": "2017-02-08T14:18:51Z"
+ }
+ ],
+ "rootPath": "github.com/etix/mirrorbits"
+}

0 comments on commit afa7c84

Please sign in to comment.