-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathIRCBot.mk
34 lines (26 loc) · 934 Bytes
/
IRCBot.mk
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
DOCKER_IMG ?= ircbot
DOCKER_BUILD_ARG :=
DOCKER_FLAGS := --rm -v $(PWD):/bot
ifeq ($(CMD),)
$(error Missing macro CMD)
endif
usage:
@echo "Make Interface"
@echo "run : run the bot normally"
@echo "docker-run : run the container in interactive mode"
@echo "docker-detached : run the container in detached mode (be sure to know how to stop detached containers :^))"
@echo "build : build the container (timestamp in .built)"
@echo "clean : you'll need to do this if you want to rebuild the bot (this will also rm the current image)"
run:
$(CMD) $(BOT)
docker-run: build
docker run -it $(DOCKER_FLAGS) $(DOCKER_IMG) $(CMD) $(BOT)
docker-detached: build
docker run -d $(DOCKER_FLAGS) $(DOCKER_IMG) $(CMD) $(BOT)
build: ../.built
../.built:
docker build $(DOCKER_BUILD_ARG) --tag=$(DOCKER_IMG) ..
echo $(shell date) > $@
clean:
$(RM) ../.built
docker image rm $(DOCKER_IMG)