Skip to content

Commit

Permalink
switch to go 1.12 and add statik pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Feb 27, 2019
1 parent 4cac1b0 commit ab33f3c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 7 deletions.
22 changes: 15 additions & 7 deletions build.go/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM golang:1.11-alpine
FROM golang:1.12-alpine

ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
ENV GOMETALINTER=2.0.12
ENV GOVERALLS=0.0.2
ENV GOLANGCI=1.13
ENV \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64 \
GOMETALINTER=2.0.12 \
GOVERALLS=0.0.2 \
GOLANGCI=1.15.0 \
STATIK=0.1.5

RUN \
apk add --no-cache --update tzdata git bash curl && \
Expand Down Expand Up @@ -40,6 +42,12 @@ RUN \
git checkout v${GOVERALLS} && \
go install github.com/mattn/goveralls

RUN \
go get -u -v github.com/rakyll/statik && \
cd /go/src/github.com/rakyll/statik && \
git checkout v${STATIK} && \
go install github.com/rakyll/statik

ADD coverage.sh /script/coverage.sh
ADD checkvendor.sh /script/checkvendor.sh
ADD git-rev.sh /script/git-rev.sh
Expand Down
40 changes: 40 additions & 0 deletions travis.go/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM umputun/baseimage:buildgo-latest

ARG CI
ARG TRAVIS
ARG TRAVIS_BRANCH
ARG TRAVIS_COMMIT
ARG TRAVIS_JOB_ID
ARG TRAVIS_JOB_NUMBER
ARG TRAVIS_OS_NAME
ARG TRAVIS_PULL_REQUEST
ARG TRAVIS_PULL_REQUEST_SHA
ARG TRAVIS_REPO_SLUG
ARG TRAVIS_TAG
ARG COVERALLS_TOKEN

ARG SKIP_TESTS
ARG SRC

WORKDIR /src
ADD ${SRC} /src
ENV GO111MODULE=on

RUN echo "source=$SRC"

# run tests
RUN \
if [ -z "$SKIP_TESTS" ] ; then \
go test -v -mod=vendor -covermode=count -coverprofile=profile.cov ./...; \
else echo "skip tests" ; fi


# linters
RUN if [ -z "$SKIP_TESTS" ] ; then \
golangci-lint run --no-config --issues-exit-code=0 --deadline=5m \
--disable-all --enable=deadcode --enable=gocyclo --enable=golint --enable=varcheck --enable=gosimple \
--enable=structcheck --enable=errcheck --enable=dupl --enable=ineffassign --enable=staticcheck \
--enable=interfacer --enable=unconvert --enable=goconst --enable=gosec --enable=govet --enable=gocritic ; \
else echo "skip linters" ; fi


0 comments on commit ab33f3c

Please sign in to comment.