Skip to content

Commit

Permalink
Build Docker image, Travis build against 2 Go versions
Browse files Browse the repository at this point in the history
  • Loading branch information
x-cray committed Nov 4, 2015
1 parent a33b742 commit 3264e16
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
language: go

go:
- tip
- 1.4
- 1.5

install: make deps
install:
- make deps

script:
- make test
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM gliderlabs/alpine:3.2

ADD . /go/src/github.com/x-cray/marathon-service-registrator
RUN apk-install -t build-deps go git \
&& cd /go/src/github.com/x-cray/marathon-service-registrator \
&& export GOPATH=/go \
&& go get \
&& go build -ldflags "-X main.version $(cat VERSION)" -o /bin/registrator \
&& rm -rf /go \
&& apk del --purge build-deps

ENTRYPOINT ["/bin/registrator"]
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
NAME=marathon-service-registrator
VERSION=$(shell cat VERSION)
DEPS = $(shell go list -f '{{range .TestImports}}{{.}} {{end}}' ./...)
PACKAGES = $(shell go list ./...)

deps:
@echo "--> Installing build dependencies"
@go get -d -v ./... $(DEPS)

docker:
docker build -t $(NAME):$(VERSION) .

test:
@echo "--> Running tests"
@go test -v -cover ./...
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Build Status](https://travis-ci.org/x-cray/marathon-service-registrator.svg?branch=master)](https://travis-ci.org/x-cray/marathon-service-registrator)
# Marathon Service Registrator
[![Build Status](https://travis-ci.org/x-cray/marathon-service-registrator.svg?branch=master)](https://travis-ci.org/x-cray/marathon-service-registrator)
[![Docker Pulls](https://img.shields.io/docker/pulls/xcray/marathon-service-registrator.svg)](https://hub.docker.com/r/xcray/marathon-service-registrator/)

Consul service registry bridge for Marathon.

Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.1
2 changes: 1 addition & 1 deletion registrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
)

var (
version = "0.0.1"
version = ""
app = kingpin.New("registrator", "Automatically registers/deregisters Marathon tasks as services in Consul.").Version(version)
consul = app.Flag("consul", "Address and port of Consul agent").Short('c').Default("http://127.0.0.1:8500").URL()
marathon = app.Flag("marathon", "URL of Marathon instance. Multiple inctances may be specified in case of HA setup: http://addr1:8080,addr2:8080,addr3:8080").Short('m').Default("http://127.0.0.1:8080").String()
Expand Down

0 comments on commit 3264e16

Please sign in to comment.