2014-07-22 20:35:00 +00:00
|
|
|
NAME=registrator
|
2015-02-18 17:53:03 +00:00
|
|
|
VERSION=$(shell cat VERSION)
|
|
|
|
|
|
|
|
dev:
|
|
|
|
docker build -f Dockerfile.dev -t $(NAME):dev .
|
|
|
|
docker run --rm \
|
|
|
|
-v /var/run/docker.sock:/tmp/docker.sock \
|
|
|
|
$(NAME):dev /bin/registrator consul:
|
2014-07-02 02:58:28 +00:00
|
|
|
|
|
|
|
build:
|
2015-02-18 17:53:03 +00:00
|
|
|
mkdir -p build
|
|
|
|
docker build -t $(NAME):$(VERSION) .
|
|
|
|
docker save $(NAME):$(VERSION) | gzip -9 > build/$(NAME)_$(VERSION).tgz
|
|
|
|
|
2015-02-18 18:23:50 +00:00
|
|
|
release:
|
2015-02-18 17:53:03 +00:00
|
|
|
rm -rf release && mkdir release
|
|
|
|
go get github.com/progrium/gh-release/...
|
|
|
|
cp build/* release
|
|
|
|
gh-release create gliderlabs/$(NAME) $(VERSION) \
|
|
|
|
$(shell git rev-parse --abbrev-ref HEAD) $(VERSION)
|
2014-07-02 18:21:05 +00:00
|
|
|
|
2015-02-18 17:53:03 +00:00
|
|
|
circleci:
|
|
|
|
rm ~/.gitconfig
|
|
|
|
ifneq ($(CIRCLE_BRANCH), release)
|
|
|
|
echo build-$$CIRCLE_BUILD_NUM > VERSION
|
|
|
|
endif
|
2014-07-03 16:58:46 +00:00
|
|
|
|
2015-02-18 17:53:03 +00:00
|
|
|
.PHONY: build release
|