Skip to content

Commit

Permalink
Merge pull request #15 from hellofresh/feature/add-travis-file
Browse files Browse the repository at this point in the history
Add travis file
  • Loading branch information
aleksandrzhiliaev authored Jul 23, 2018
2 parents e7daad8 + 60114cf commit 7074f86
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: go

services:
- docker

go:
- "1.x"
- "1.8"
- "1.9"
- "1.10"

before_install:
- docker-compose up -d

install:
- mkdir -p $GOPATH/bin
- make deps

script:
- make all

after_script:
- docker-compose down -v
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
all: lint test
OK_COLOR=\033[32;01m
NO_COLOR=\033[0m

all: deps lint test checks

lint:
@echo "$(OK_COLOR)==> Linting... $(NO_COLOR)"
@go vet ./...

test:
@go test -v -cover ./...

deps:
@echo "$(OK_COLOR)==> Installing dependencies $(NO_COLOR)"
@go get -u gopkg.in/mgo.v2
@go get -u github.com/go-sql-driver/mysql
@go get -u github.com/lib/pq
@go get -u github.com/streadway/amqp
@go get -u github.com/garyburd/redigo/redis

checks:
@docker-compose up -d
@sleep 3
@echo "Running checks tests against container deps" && \
@echo "$(OK_COLOR)==> Running checks tests against container deps $(NO_COLOR)" && \
HEALTH_GO_PG_DSN="postgres://test:test@`docker-compose port postgres 5432`/test?sslmode=disable" \
HEALTH_GO_MQ_DSN="amqp://guest:guest@`docker-compose port rabbit 5672`/" \
HEALTH_GO_RD_DSN="redis://`docker-compose port redis 6379`/" \
HEALTH_GO_MG_DSN="`docker-compose port mongo 27017`/" \
HEALTH_GO_MS_DSN="test:test@tcp(`docker-compose port mysql 3306`)/test?charset=utf8" \
go test -v -cover ./...

.PHONY: all test lint checks
.PHONY: all deps test lint checks
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# health-go
[![Build Status](https://travis-ci.com/hellofresh/health-go.svg?branch=master)](https://travis-ci.com/hellofresh/health-go)

* Exposes an HTTP handler that retrieves health status of the application
* Implements some generic checkers for the following services:
Expand Down

0 comments on commit 7074f86

Please sign in to comment.