forked from liggitt/auth-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (26 loc) · 1.17 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
NAME = liggitt/auth-proxy
VERSION = 0.1.0
.PHONY: all build test tag_latest release
all: build tag_latest
build:
docker build -t $(NAME):$(VERSION) --rm .
test:
env NAME=$(NAME) VERSION=$(VERSION) ./test/runner.sh
run:
ifndef BACKEND
@echo '$$(BACKEND) must be defined (e.g. BACKEND=https://1.2.3.4:8443 make run)'
@exit 1
endif
ifndef PROXY_HOST
@echo '$$(PROXY_HOST) is not defined, using mydomain.com'
docker run -p 80:80 -p 88:88 -p 88:88/udp -p 443:443 -h mydomain.com -v /dev/urandom:/dev/random -e BACKEND=$(BACKEND) -ti $(NAME)
else
docker run -p 80:80 -p 88:88 -p 88:88/udp -p 443:443 -h $(PROXY_HOST) -v /dev/urandom:/dev/random -e BACKEND=$(BACKEND) -ti $(NAME)
endif
tag_latest:
docker tag -f $(NAME):$(VERSION) $(NAME):latest
release: test tag_latest
@if ! docker images $(NAME) | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME) version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! head -n 1 Changelog.md | grep -q 'release date'; then echo 'Please note the release date in Changelog.md.' && false; fi
docker push $(NAME)
@echo "*** Don't forget to create a tag. git tag rel-$(VERSION) && git push origin rel-$(VERSION)"