diff --git a/.travis.yml b/.travis.yml index 9cb6efc1..99526ac4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ install: script: - docker build --build-arg COVERALLS_TOKEN=$COVERALLS_TOKEN + --build-arg CODECOV_TOKEN=$CODECOV_TOKEN --build-arg CI=$CI --build-arg TRAVIS=$TRAVIS --build-arg TRAVIS_BRANCH=$TRAVIS_BRANCH diff --git a/Dockerfile b/Dockerfile index a2a84df5..eaae4397 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM umputun/baseimage:buildgo-latest as build-backend ARG COVERALLS_TOKEN +ARG CODECOV_TOKEN ARG CI ARG TRAVIS ARG TRAVIS_BRANCH @@ -27,10 +28,15 @@ 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 \ +RUN if [ -z "$COVERALLS_TOKEN" ] ; then \ echo coverall not enabled ; \ else goveralls -coverprofile=.cover/cover.out -service=travis-ci -repotoken $COVERALLS_TOKEN; fi +RUN if [ -z "$CODECOV_TOKEN" ] ; then \ + echo codecov not enabled ; \ + else curl -s https://codecov.io/bash -o codecov && \ + bash codecov -f .cover/cover.out -X fix; fi + 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