From e3a7f53412f8f7f111c17a15205c49756bfc5169 Mon Sep 17 00:00:00 2001 From: sneak Date: Tue, 17 Mar 2020 21:02:06 -0700 Subject: [PATCH] adds CI config and dockerfile --- .drone.yml | 9 +++++++++ Dockerfile | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..cdd4355 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,9 @@ +kind: pipeline +name: default + +pipeline: + build: + image: plugins/docker + commands: + - > + docker build . diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ddeb0c9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM golang:1.13 as builder + +WORKDIR /go/src/git.eeqj.de/datavibe/api +COPY . . + +#RUN make lint && make build +RUN make build + +WORKDIR /go +RUN tar cvfz go-src.tgz src && du -sh * + +# this container doesn't do anything except hold the build artifact +# and make sure it compiles. + +FROM alpine + +COPY --from=builder /go/src/git.eeqj.de/datavibe/api/api /bin/api + +# put the source in there too for safekeeping +COPY --from=builder /go/go-src.tgz /usr/local/src/go-src.tgz + +CMD /bin/api + +# FIXME add testing