diff --git a/.travis.yml b/.travis.yml index 8d6e6875..ce10622f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,6 @@ -language: go - -go: - - "1.10.x" - -before_install: - - go get golang.org/x/tools/cmd/cover - - go get github.com/mattn/goveralls - install: - docker --version - docker-compose --version script: - - docker build . - -after_success: - - echo 'America/Chicago' | sudo tee /etc/timezone - - sudo dpkg-reconfigure --frontend noninteractive tzdata - - go test $(go list -e ./... | grep -v vendor) -covermode=count -coverprofile=coverage.out - - goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN + - docker build --build-arg COVERALLS_TOKEN=$COVERALLS_TOKEN . diff --git a/Dockerfile b/Dockerfile index 359e1afa..0ee24e99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM umputun/baseimage:buildgo-latest as build-backend +ARG COVERALLS_TOKEN +ENV COVERALLS_TOKEN=$COVERALLS_TOKEN + WORKDIR /go/src/github.com/umputun/remark ADD app /go/src/github.com/umputun/remark/app @@ -13,6 +16,11 @@ RUN gometalinter --disable-all --deadline=300s --vendor --enable=vet --enable=ve RUN mkdir -p target && /script/coverage.sh +RUN if [ "x$COVERALLS_TOKEN" = "x" ] ; then \ + echo coverall not enabled ; \ + else go get github.com/mattn/goveralls && \ + goveralls -coverprofile=.cover/cover.out -service=travis-ci -repotoken $COVERALLS_TOKEN; fi + ADD .git /go/src/github.com/umputun/remark/.git RUN go build -o remark -ldflags "-X main.revision=$(git rev-parse --abbrev-ref HEAD)-$(git describe --abbrev=7 --always --tags)-$(date +%Y%m%d-%H:%M:%S) -s -w" ./app