forked from robcza/logspout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (33 loc) · 1001 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
NAME=logspout
VERSION=$(shell cat VERSION)
dev:
@docker history $(NAME):dev &> /dev/null \
|| docker build -f Dockerfile.dev -t $(NAME):dev .
@docker run --rm \
-e DEBUG=true \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/go/src/github.com/gliderlabs/logspout \
-p 8000:80 \
-e ROUTE_URIS=$(ROUTE) \
$(NAME):dev
build:
mkdir -p build
docker build -t $(NAME):$(VERSION) .
docker save $(NAME):$(VERSION) | gzip -9 > build/$(NAME)_$(VERSION).tgz
release:
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)
circleci:
rm ~/.gitconfig
ifneq ($(CIRCLE_BRANCH), release)
echo build-$$CIRCLE_BUILD_NUM > VERSION
endif
clean:
rm -rf build/
docker rm $(shell docker ps -aq) || true
docker rmi $(NAME):dev $(NAME):$(VERSION) || true
docker rmi $(shell docker images -f 'dangling=true' -q) || true
.PHONY: release clean