version detection travis friendly
This commit is contained in:
parent
9cc7f05bd3
commit
b896912dcf
1 changed files with 3 additions and 6 deletions
|
@ -12,11 +12,6 @@ ARG TRAVIS_PULL_REQUEST
|
||||||
ARG TRAVIS_PULL_REQUEST_SHA
|
ARG TRAVIS_PULL_REQUEST_SHA
|
||||||
ARG TRAVIS_REPO_SLUG
|
ARG TRAVIS_REPO_SLUG
|
||||||
ARG TRAVIS_TAG
|
ARG TRAVIS_TAG
|
||||||
ARG DRONE
|
|
||||||
ARG DRONE_TAG
|
|
||||||
ARG DRONE_COMMIT
|
|
||||||
ARG DRONE_BRANCH
|
|
||||||
ARG DRONE_PULL_REQUEST
|
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/umputun/rss2twitter
|
WORKDIR /go/src/github.com/umputun/rss2twitter
|
||||||
ADD . /go/src/github.com/umputun/rss2twitter
|
ADD . /go/src/github.com/umputun/rss2twitter
|
||||||
|
@ -38,7 +33,9 @@ RUN if [ -z "$COVERALLS_TOKEN" ] ; then \
|
||||||
else goveralls -coverprofile=.cover/cover.out -service=travis-ci -repotoken $COVERALLS_TOKEN || echo "coverall failed!"; fi
|
else goveralls -coverprofile=.cover/cover.out -service=travis-ci -repotoken $COVERALLS_TOKEN || echo "coverall failed!"; fi
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
version=$(/script/git-rev.sh) && \
|
if [ -z "$TRAVIS" ] ; then \
|
||||||
|
echo "runs outside of travis" && version=$(/script/git-rev.sh); \
|
||||||
|
else version=${TRAVIS_TAG}${TRAVIS_BRANCH}${TRAVIS_PULL_REQUEST}-${TRAVIS_COMMIT:0:7}-$(date +%Y%m%dT%H:%M:%S); fi && \
|
||||||
echo "version=$version" && \
|
echo "version=$version" && \
|
||||||
go build -o rss2twitter -ldflags "-X main.revision=${version} -s -w" ./app
|
go build -o rss2twitter -ldflags "-X main.revision=${version} -s -w" ./app
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue