Fix travis

This commit is contained in:
Niko Storni 2019-02-27 14:38:43 +01:00
parent 91fe8ba459
commit 5696bda102
4 changed files with 33 additions and 20 deletions

3
.gitignore vendored
View file

@ -1,2 +1 @@
/ytsync
/vendor
bin/

View file

@ -1,5 +1,15 @@
os: linux
dist: trusty
dist: xenial
language: go
go_import_path: github.com/lbryio/ytsync
# Only the last two Go releases are supported by the Go team with security
# updates. Any versions older than that should be considered deprecated.
# Don't bother testing with them. tip builds your code with the latest
# development version of Go. This can warn you that your code will break
# in the next version of Go. Don't worry! Later we declare that test runs
# are allowed to fail on Go tip.
go:
- "1.10.x"
- 1.11.5
- master
env:
- GO111MODULE=on

View file

@ -1,23 +1,25 @@
BINARY=ytsync
BINARY=prism-bin
DIR = $(shell cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
VENDOR_DIR = vendor
BIN_DIR = ${DIR}/bin
IMPORT_PATH = github.com/lbryio/ytsync
VERSION = $(shell git --git-dir=${DIR}/.git describe --dirty --always --long --abbrev=7)
LDFLAGS = -ldflags "-X main.Version=${VERSION}"
LDFLAGS = -ldflags "-X ${IMPORT_PATH}/meta.Version=${VERSION} -X ${IMPORT_PATH}/meta.Time=$(shell date +%s)"
.PHONY: build dep clean
.PHONY: build clean test lint
.DEFAULT_GOAL: build
build: dep
CGO_ENABLED=0 go build ${LDFLAGS} -asmflags -trimpath=${DIR} -o ${DIR}/${BINARY} *.go
dep: | $(VENDOR_DIR)
$(VENDOR_DIR):
go get github.com/golang/dep/cmd/dep && dep ensure
build:
mkdir -p ${BIN_DIR} && CGO_ENABLED=0 go build ${LDFLAGS} -asmflags -trimpath=${DIR} -o ${BIN_DIR}/${BINARY} main.go
clean:
if [ -f ${DIR}/${BINARY} ]; then rm ${DIR}/${BINARY}; fi
if [ -f ${BIN_DIR}/${BINARY} ]; then rm ${BIN_DIR}/${BINARY}; fi
test:
go test ./... -v -cover
lint:
go get github.com/alecthomas/gometalinter && gometalinter --install && gometalinter ./...

View file

@ -12,6 +12,8 @@ import (
"github.com/lbryio/lbry.go/extras/errors"
"github.com/lbryio/lbry.go/extras/null"
log "github.com/sirupsen/logrus"
)
const (