Skip to content
Permalink
Browse files

Tests and Dockerfile

  • Loading branch information...
Depado committed Nov 12, 2017
1 parent efc7e79 commit 31b9b0f49fc927accc3836c677628a7d4538a528
Showing with 27 additions and 2 deletions.
  1. +2 −2 .drone.yml
  2. +13 −0 Dockerfile
  3. +12 −0 test.sh
@@ -1,6 +1,6 @@
workspace:
base: /go
path: src/github.com/Depado/goploader/
path: src/github.com/Depado/gomonit/

matrix:
ARCH:
@@ -26,7 +26,7 @@ pipeline:
test:
image: golang:1.9
commands:
- go test -race -coverprofile=coverage.txt -covermode=atomic
- test.sh

codecov:
image: robertstettner/drone-codecov
@@ -0,0 +1,13 @@
FROM golang:1.9 AS build
RUN mkdir -p $GOPATH/src/github.com/Depado/gomonit
ADD . $GOPATH/src/github.com/Depado/gomonit
WORKDIR $GOPATH/src/github.com/Depado/gomonit
RUN go get -u github.com/golang/dep/cmd/dep
RUN dep ensure
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o gomonit
RUN cp gomonit /

FROM golang:1.9
COPY --from=build /gomonit /usr/bin/
ENTRYPOINT ["/usr/bin/gomonit"]
EXPOSE 8080
12 test.sh
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -e
echo "" > coverage.txt

for d in $(go list ./... | grep -v vendor); do
go test -race -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done

0 comments on commit 31b9b0f

Please sign in to comment.
You can’t perform that action at this time.