Skip to content

Commit

Permalink
travis ci
Browse files Browse the repository at this point in the history
  • Loading branch information
f1yegor committed Aug 23, 2017
1 parent ff215f5 commit 751549a
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
dist: trusty
sudo: required
language: go

go:
- 1.8.x
- master

services:
- docker

before_script:
- docker --version
- docker-compose --version
- docker-compose -f docker-compose.yml up -d

script:
- make init
- make cover

after_success:
- bash <(curl -s https://codecov.io/bash) -X fix
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributing notes

## Local setup

The easiest way to make a local development setup is to use Docker Compose: `make env-run` on Linux.

You can run ClickHouse client with `make clickhouse-client`.


## Vendoring

We use [dep](https://github.com/golang/dep) to vendor dependencies. Please use released version, i.e. do not `go get`
from `master` branch.
7 changes: 7 additions & 0 deletions Makefile.COMMON
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ GO_VERSION ?= 1.8.3
GOURL ?= https://golang.org/dl
GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH)$(RELEASE_SUFFIX).tar.gz
GOPATH := $(CURDIR)/.build/gopath
PACKAGES := $(shell go list ./... | grep -v vendor)

# Check for the correct version of go in the path. If we find it, use it.
# Otherwise, prepare to build go locally.
Expand Down Expand Up @@ -120,3 +121,9 @@ format: $(GOCC)
.PHONY: clean
clean:
rm -rf $(BINARY) $(ARCHIVE) .build *-stamp

init:
go get -u github.com/AlekSi/gocoverutil

cover: install
gocoverutil test -v $(PACKAGES)
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
version: '3'
services:
prometheus:
image: prom/prometheus:v2.0.0-beta.2
ports:
- 127.0.0.1:9090:9090
network_mode: host
volumes:
- ./docker/prometheus:/etc/prometheus

clickhouse:
image: yandex/clickhouse-server
ports:
- 127.0.0.1:8123:8123
- 127.0.0.1:9000:9000
- 127.0.0.1:9009:9009
network_mode: host
# volumes:
# - ./config.xml:/etc/clickhouse-server/config.xml
# - ./users.xml:/etc/clickhouse-server/users.xml

clickhouse_exporter:
image: f1yegor/clickhouse-exporter
ports:
- 127.0.0.1:9116:9116
network_mode: host
command: -scrape_uri=http://127.0.0.1:8123/
13 changes: 13 additions & 0 deletions docker/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
global:
scrape_interval: 1s
evaluation_interval: 1s

scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['127.0.0.1:9090']

- job_name: clickhouse
static_configs:
- targets: ['127.0.0.1:9116']

0 comments on commit 751549a

Please sign in to comment.