Move test into Dockerfile

This commit is contained in:
Richard Patel 2019-02-22 05:02:30 +01:00
parent 2b719ccd3f
commit 10af43c12f
No known key found for this signature in database
GPG Key ID: C268B2BBDA2ABECB
2 changed files with 2 additions and 9 deletions

View File

@ -1,21 +1,13 @@
# https://ops.tips/blog/travis-ci-push-docker-image/
language: go
go:
- "1.11.x"
sudo: required sudo: required
services: services:
- docker - docker
script: script:
- go test .
- docker build -t terorie/od-database-crawler . - docker build -t terorie/od-database-crawler .
after_success: after_success:
- if [[ "$TRAVIS_BRANCH" == "stable" ]]; then - if [[ "$TRAVIS_BRANCH" == "stable" ]]; then
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ; docker login -u terorie -p $DOCKER_PASSWORD ;
docker push terorie/od-database-crawler ; docker push terorie/od-database-crawler ;
fi fi

View File

@ -1,6 +1,7 @@
FROM golang:1.11.5 AS builder FROM golang:1.11.5 AS builder
ADD . /src ADD . /src
RUN cd /src \ RUN cd /src \
&& go test . \
&& go build -o binary && go build -o binary
FROM alpine FROM alpine