Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Update Dockerfile #112

Merged
merged 10 commits into from
Apr 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -4,3 +4,6 @@
mesos-consul
build/
.idea/

vendor
bin/
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -2,9 +2,15 @@
language: go

go:
- 1.6
- 1.7.x
- tip

install: go get -v -t ./....
go_import_path: github.com/CiscoCloud/mesos-consul

script: go test -v ./...
install:
- go get -v github.com/Masterminds/glide
- cd $GOPATH/src/github.com/Masterminds/glide && git checkout tags/v0.12.3 && go install && cd -
- glide install
- make vendor

script: make test
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM gliderlabs/alpine:3.1
FROM golang:1.7.5-alpine3.5

MAINTAINER Chris Aubuchon <Chris.Aubuchon@gmail.com>

COPY . /go/src/github.com/CiscoCloud/mesos-consul
RUN apk add --update go git mercurial \
RUN apk add --update make git glide \
&& cd /go/src/github.com/CiscoCloud/mesos-consul \
&& export GOPATH=/go \
&& go get \
&& make vendor \
&& go build -o /bin/mesos-consul \
&& rm -rf /go \
&& apk del --purge go git mercurial
&& apk del --purge make git glide

ENTRYPOINT [ "/bin/mesos-consul" ]
27 changes: 13 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
TEST?=./...
TEST?=$$(glide nv)
NAME = $(shell awk -F\" '/^const Name/ { print $$2 }' main.go)
VERSION = $(shell awk -F\" '/^const Version/ { print $$2 }' main.go)
DEPS = $(shell go list -f '{{range .TestImports}}{{.}} {{end}}' ./...)

all: deps build
all: build

deps:
go get -d -v ./...
echo $(DEPS) | xargs -n1 go get -d

updatedeps:
go get -u -v ./...
echo $(DEPS) | xargs -n1 go get -d

build: deps
build:
@mkdir -p bin/
go build -o bin/$(NAME)

test: deps
test:
go test $(TEST) $(TESTARGS) -timeout=30s -parallel=4
go vet $(TEST)

xcompile: deps test
xcompile: test
@rm -rf build/
@mkdir -p build
gox \
@@ -42,4 +34,11 @@ package: xcompile
echo $$f; \
done

.PHONY: all deps updatedeps build test xcompile package
vendor:
glide install --strip-vendor
glide update --strip-vendor

vendor-clean:
-rm -rf vendor/

.PHONY: all updatedeps build test xcompile package vendor vendor-clean
44 changes: 44 additions & 0 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package: github.com/CiscoCloud/mesos-consul
import:
- package: github.com/hashicorp/consul
subpackages:
- api
- package: github.com/mesos/mesos-go
version: mesos-0.26.0
subpackages:
- detector
- detector/zoo
- mesosproto
- upid
- package: github.com/ogier/pflag
- package: github.com/sirupsen/logrus
6 changes: 0 additions & 6 deletions mesos/mesos.go
Original file line number Diff line number Diff line change
@@ -13,16 +13,10 @@ import (
"github.com/CiscoCloud/mesos-consul/registry"
"github.com/CiscoCloud/mesos-consul/state"

consulapi "github.com/hashicorp/consul/api"
proto "github.com/mesos/mesos-go/mesosproto"
log "github.com/sirupsen/logrus"
)

type CacheEntry struct {
service *consulapi.AgentServiceRegistration
isRegistered bool
}

type Mesos struct {
Registry registry.Registry
Agents map[string]string