This repository has been archived by the owner on Aug 3, 2021. It is now read-only.
forked from gliderlabs/registrator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
56 lines (46 loc) · 1.58 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.PHONY: build
NAME=registrator
VERSION=$(shell cat VERSION)
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
DEV_RUN_OPTS ?=-ttl 30 -ttl-refresh 15 -ip 127.0.0.1 -require-label eureka://127.0.0.1:8090/eureka/v2
PROD_RELEASE_TAG=761584570493.dkr.ecr.us-east-1.amazonaws.com/registrator:latest
TEST_TAG=761584570493.dkr.ecr.us-east-1.amazonaws.com/registrator:$(BRANCH)
prep-dev: teardown
docker run --rm --name reg_eureka -td -p 8090:8080 netflixoss/eureka:1.1.147
docker build -f Dockerfile.dev -t $(NAME):dev .
teardown:
docker kill reg_eureka; true
dev: prep-dev dev-run teardown
dev-verbose: prep-dev dev-run-verbose teardown
dev-run:
docker run -ti --rm \
--net=host \
-v /var/run/docker.sock:/tmp/docker.sock \
-e "FARGO_LOG_LEVEL=NOTICE" \
-e "SERVICE_EUREKA_DATACENTERINFO_AUTO_POPULATE=false"\
$(NAME):dev $(DEV_RUN_OPTS)
dev-run-resync:
docker run -ti --rm \
--net=host \
-v /var/run/docker.sock:/tmp/docker.sock \
-e "FARGO_LOG_LEVEL=NOTICE" \
$(NAME):dev -resync 30 $(DEV_RUN_OPTS)
dev-run-verbose:
docker run -ti --rm \
--net=host \
-v /var/run/docker.sock:/tmp/docker.sock \
-e "REGISTRATOR_LOG_LEVEL=DEBUG" \
-e "FARGO_LOG_LEVEL=DEBUG" \
$(NAME):dev $(DEV_RUN_OPTS)
build:
mkdir -p build
docker build -t $(NAME):$(VERSION) .
docker save $(NAME):$(VERSION) | gzip -9 > build/$(NAME)_$(VERSION).tgz
test:
docker build -t $(TEST_TAG) .
docker push $(TEST_TAG)
release:
docker build -t $(PROD_RELEASE_TAG) .
docker push $(PROD_RELEASE_TAG)
run-test-container:
docker run -d --entrypoint tail -e "SERVICE_REGISTER=true" -p 5000:5000 --rm busybox -f /dev/null