FROM golang:1.12

##
## -- This dockerfile is used in `make test` which you can use to run the tests and
##    gometalinter locally before pushing a commit
##

RUN go get -u honnef.co/go/tools/cmd/staticcheck
RUN mkdir -p /go/src/code.justin.tv/extensions/discovery

WORKDIR /go/src/code.justin.tv/extensions/discovery

ADD all.c7 all.c7
ADD tools.json tools.json
ADD auth auth
ADD cmd cmd
ADD data data
ADD fultonlibs fultonlibs
ADD golibs golibs
ADD interfaces interfaces
ADD manager manager
ADD sliceutils sliceutils
ADD twirputils twirputils
ADD vendor vendor

RUN go test ./...
RUN cd cmd/discovery && go install ./...
RUN staticcheck ./...
